run 10 jobs in random order within another one
MDM
![]()
- Joined: Jul 8, 2011
- Posts: 38
hi,
I just spent a few hours trying to complete a job... but i got totally stuck.
here's what I want to do.
i want to run 10 jobs in random order and call a few other actions (which i dont mention here in order to keep it simple) between each of the 10 jobs.
example:
- start
- load a list with the 10 names of the jobs from a textfile
- shuffle the list
- run the first job of the shuffled list
- run some other actions
- run the second job from the shuffled list
- run some other actions
- run the third job from the shuffled list
.... and so on.. until all 10 are done.
it would be awesome if anyone could tell me how to accomplis this or point me to a similar example job that will help me figure out the solution on my own.
Samantha
![]()
- Joined: Apr 23, 2010
- Posts: 2326
MDM
![]()
- Joined: Jul 8, 2011
- Posts: 38
Hello Samantha,
thank you VERY much for your kind help.
To be quite honest, I don't fully understand it by now.... mainly because of the "advanced" configuration of the commands. for example the placement of the brackets in the following line.
WinAutomationController /start "%Jobs[Random[1]]"
if i am correct, it means the first line of the variable named "random" inside the "jobs" variable.
my main problem is, that i cannot find anything about those advanced topics in the manual. for example i never would have figured out on my own how to use the brackeets in this case and the numbering. although the fact that a list starts at zero and not at 1 is mentioned in the manual - and you also reminded me on that in yesterdays post ; )
where can i find the required documentation to understand these things better? so that i am not so much dependant on help from others.
one more question about the actual task... the 10 jobs that i want to call are actually WA jobs, so I thought I would have to use the "run job" command. I guess I confused you because i was saying that I want to load the job names from an external list. the reason for this is as follows. this task is indended to become an easy to modify "template" - so in case i want to use it for a similar purpose, but with different named jobs i thought it would be a lot easier to just edit a txt file instead of all the 10 entries inside the main job itself.
so to sum it up for now... will the example that you gave me still work if i use "run job" instead of "rund dos command" and where can i find the advanced documentation?
oh, and one last thing.... on the main WA webpage and also in the manual i noticed that "nesting" was mentioned several times and that it is such a great thing.... but i couldn't find any further explanation about that either. did i just miss it? if you know any link or place where these things are explained a bit more in detail please let me know.
THANK YOU : ) your kind assistance is very much appreciated!
Samantha
![]()
- Joined: Apr 23, 2010
- Posts: 2326
MDM
![]()
- Joined: Jul 8, 2011
- Posts: 38
Hello Samantha,
I think you missed something in my previous post.... probablyi was writing too much ; )
the question was if the provided solution would also work for actual "jobs" and not for external programs. tonight i already figured out by myself, that it does in fact not work with jobs.
i was confusing you because i was mentioning the external list with the job names that i want to load. the reason for this list is simple. from my main job i want to call 10 jobs in a random order. on the next day for example i want to run the same main job again... but this time with 10 different random jobs. lets say for example i have 50 jobs and each day i want to run 10 jobs out of the 50 but in a random order. a few weeks later the list might have increased already to 70 available jobs.
in order to keep it simple and not having to modify the main job each day i want to only modifiy the list in the textfile. this would be the fastest solution i think, do you know what i mean? since the 1st solution that you suggested seems to work only for external programs (i did not find a way how to put a variable into the "job to run" action input) - can you think of a different solution that will work with jobs rathen than external programs?
also.... thank you very much for the throrough explanation of the bracketing system. It all makes sense this way.
I still think it would be a VERY good idea to compile all the advanced information which is related to this and put it into a section of the manual.
Similar to the action reference, where each action is briefly explained. Likewise each advanced command and alteration should be at least mentioned once by name.
The reason why i suggest this is simple. you said this information is spread around in the forums, cookbook etc. this is good and useful. but only as long as a user knows what he is looking for. since I do not know what to ask for I cannot use the search... and posting a question on the board is just too slow in most cases, especially since many problems cannot be solved with the first answer it might take days until one problem is solved.... eventhough the responserate on this board is FAR above average - thanks to your great efforts ; ) if i know for example that a bracketing system exists and if i know just a little bit about what it is used for, i can search the forums - because i know the search term. this way around, it makes it alot easier, at least for me ; )
I had a feeling that those commands and terms are not WA exclusive and probably are used in a similar way like regular expressions can be used. in which case an "external" documantation would exist
EDIT: after trying some more to figure out a way to do the "run job" actions in a random order I still couldn't find a way that works. I had all kinds of solutions in mind... for example using the clipboard for the names. But I always get stuck where I need to put in the name of the job. Since it seems that it only can be chosen manually from the dropdown list right inside the properties window and not otherwise. Do you have another idea?
Samantha
![]()
- Joined: Apr 23, 2010
- Posts: 2326
MDM
![]()
- Joined: Jul 8, 2011
- Posts: 38
thank you : )
MDM
![]()
- Joined: Jul 8, 2011
- Posts: 38
hmmm..... after examining the link with the solution more thorough i noticed that this is basically the same solution like the one you were using already in the first example.
while it actually DOES run there is still a huge difference (please correct me if i'm wrong) I still cannot activate "wait for job to complete" which is vital in my case since between each call some actions are called - like in the first example. this is why i was asking once again after the first one. or is it maybe possible with a special commandline parameter?
I also need to know it the job completed successfully, but the exception of the dos command only applies for the command itself, not the the program it called, right?
Samantha
![]()
- Joined: Apr 23, 2010
- Posts: 2326
MDM
![]()
- Joined: Jul 8, 2011
- Posts: 38
Great Idea Samantha! I this has got to work perfectly
I probably should have figured this on my onw by now - after spending so much time on it ; )
In the mean time one more question came up. Is there a way I can "read" a variable from a different job which is already finished?
I was already trying it with the persistent flag, but it seems that it is bound to the job itself, not to the name of the variable, right? in other words... if i flag a %TestValue% variable to be persistent inside a job called "test one" and the job is finished, I can read the value of the variable the nex time the "test one" job is executed, but not if I make any other job with a %TextValue% variable.
how can I store a variable of a finished job and read it in another job. and also, how could i pass variables around from job to job while they are still open?
Samantha
![]()
- Joined: Apr 23, 2010
- Posts: 2326