Delay in Process Flow

 13 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
L G
Advanced Member Send Private Message
Posts: 38
Advanced Member
Hi
I have 2 web run nodes that call 2 different jobs in a process flow. Now I need to introduce a delay in the flow or a way to ensure that the first job has completed before the second one runs.
or is there a way to change the step  parameters of a multi step job from within Process Flow if I integrate the 2 web run nodes in Process Flow.

Both the jobs that are being called within the 2 web run are also modified within the flow via AGS calls with different parameters on each run based on the service variables.

Can you suggest the best approach
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
If you add &WAIT=true to the end of your jobrun string then ProcessFlow will wait until the job finishes before moving forward.
David Williams
kim
Basic Member Send Private Message
Posts: 15
Basic Member
Morning David:
Thank you in advance for your help.

RE: use of &WAIT=true with the webrun

Background:
pfuser = service account for process flow

I have an AGS call to create/update parameters for the batch job followed by the webrun if the create/update were successful. When the webrun command is executed, job is active in jobschd, it does wait but only one minute then it executes again and fails even though the job is still active in jobschd, triggering a failure step when in fact it has not failed--yet.
I am making an assumption that the subsequent executions after each minute that ProcessFlow is querying GEN.QUEUEDJOB-STATUS to validate that the job is indeed still running. Is this a true assumption? If so, why would it fail on subsequent tries? Do you know of any documentation that gives troubleshooting tips and tricks?

error message if submitted job runs longer than one minute:
Executing WebRun Activity WebRun3770.....
Posting to URL cgi-lawson/jobrun.exe?FUNC=run&USER=pfuser&JOB=0727110722&WAIT=true
Post content:
WebRun3770_errorCode = 1
WebRun3770_informationCode = 0
WebRun3770_returnMessage = Error connecting to /cgi-lawson/jobrun.exe?FUNC=run&USER=pfuser&JOB=0727110722&WAIT=true with user pfuser Query string
WebRun3770_outputData =
Error while executing WebRun activity
Error connecting to /cgi-lawson/jobrun.exe?FUNC=run&USER=pfuser&JOB=0727110722&WAIT=true with user pfuser Query string
WebRun3770_result = Error connecting to /cgi-lawson/jobrun.exe?FUNC=run&USER=pfuser&JOB=0727110722&WAIT=true with user pfuser Query string
Executing Stop Activity .....

edited after posting to correct soit would not show the hyperlinks but the text
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
This actually looks like a security error. Is pfuser setup in laua? It has to be in order to run a batch job.
David Williams
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
Are the jobs setup under the pfuser ID? You can run a job defined as user1 if you have security rights and the jobrun.exe has to be set to run the job as the user the job is defined for.
David Williams
John Henley
Send Private Message
Posts: 3351
Is this Windows?
Are you running this from the Designer?=
Thanks for using the LawsonGuru.com forums!
John
kim
Basic Member Send Private Message
Posts: 15
Basic Member
Morning all:
we are Unix.
yes the original jobs are owned and submitted by pfuser. 
yes pfuser is setup in laua.
John Henley
Send Private Message
Posts: 3351
Are you seeing this behavior from the designer or on the server?=
Thanks for using the LawsonGuru.com forums!
John
kim
Basic Member Send Private Message
Posts: 15
Basic Member
I am within the ProcessFlow designer.
Sam Simpson
Veteran Member Send Private Message
Posts: 239
Veteran Member
I added a javascript function in pflow.js to pause for a number of milliiseconds (1000 milliiseconds = 1 seconds) by using date variables. I used this a lot specially to monitor for jobs and also for checking multiple interface files used by my ScanFileClient. An example would be processing two files for AP. The ScanFileClient will checked if the second file is already present. If the file is not there yet, then it will pause for 5 minutes. It will also count how many times the flow has loop thru the pause function and if the count exceeded the loop limit (like 3 times), then it will send email message that the file did not reach the system.

It just a simple script and let me know if want me to post it here.
kim
Basic Member Send Private Message
Posts: 15
Basic Member
Hi Sam,
We do have older process flows that use AGS to update/add job, jqsubmit to submit it, and query QUEUEDJOB with sixty second pause loops.  When I saw David's webrun solution and wanted to give it a try so we wouldn't have to do it the old way if at all possible.

Thanks for the suggestion.
John Henley
Send Private Message
Posts: 3351
I experienced similar behavior (on Windows) for the webrun node when running from the designer.
However, the flow worked just fine once deployed and run on the server.

Thanks for using the LawsonGuru.com forums!
John
kim
Basic Member Send Private Message
Posts: 15
Basic Member
Thanks John it did as expected when deployed to the server.  I then took it a step further and purposely had the job go into needs recovery and the webrun node finished with the Found Success string message.  I am guessing I will always need to query QUEUEDJOB after the webrun node to confirm it was actually successful or failed so I will continue down that path unless I hear otherwise.

Love LawsonGuru for all the help and support!  Thank you all.
Shane Jones
Veteran Member Send Private Message
Posts: 460
Veteran Member
That is a great solution. I have flows where I do a simple could in a branch and it just loops through a VAR+1 until it reaches a set number and then proceeds with the flow. It works when I can't query something and just need an abitratry pause. This solution would probably be much cleaner and use less system resources.

Thanks
Shane Jones
Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
** Teach others to fish...