Wednesday, October 31, 2012

Workflow Scheduling

Schedule a workflow to run continuously:-

You can schedule a workflow to run continuously. A continuous workflow starts as soon as the Integration Service initializes. If you schedule a real-time session to run as a continuous workflow, the Integration Service starts the next run of the workflow as soon as it finishes the first. When the workflow stops, it restarts immediately.

Alternatively for normal scenario you can create conditional-continuous workflow as below.
Suppose wf_Bus contains the business session that we want to run continuosly untill a certain conditions is meet before it stops, may be presence of file or particular value of workflow variable etc.

So modify the workflow as Start-Task followed by Decision Task which evaluates a condition to be TRUE or FALSE. Based on this condition the workflow will run or stop. Next use the link task to link the business session for $Decision.Condition=TRUE. For the other part use a Command Task for $Decision.Condition=FALSE. In the command task create a command to call a dummy workflow using pmcmd functionality.
e.g. "C:\Informatica\PowerCenter8.6.0\server\bin\pmcmd.exe" startworkflow -sv IS_info_repo8x -d Domain_hp -u info_repo8x -p info_repo8x -f WorkFolder wf_dummy

Next create another workflow name it as wf_dummy and again place a Command Task after the Start Task. Within the command task put the pmcmd command as
"C:\Informatica\PowerCenter8.6.0\server\bin\pmcmd.exe" startworkflow -sv IS_info_repo8x -d Domain_sauravhp -u info_repo8x -p info_repo8x -f WorkFolder wf_Bus

In this manner you can manage to run workflows continuosly, so the basic concept is to use two workflows and make them call each other.

2nd way to do above task
You can also try this one.
Create a shell script, the content would be:
-----------------------------
while [ $variable_V1 == TRUE && $variable_V2 == TRUE ]
do

1) pmcmd command to trigger the WF
2) condition which will decide the value of "variable_V1"
3) *position* here you will set the value of "variable_V2" based on the status of the execution of your WF which ran previously.

done
exit 0
------------------------------
Every time if the condition is true, it will go inside the loop and will trigger the WF and if your condition is not met, it will come out of the loop.
this is just an example, you can modify this script according to your need. If you follow this approach, you don't have to schedule this WF using Informatica scheduler. Execute this script and this will keep on executing the WF until the condition is not met.

Additional:
Suppose you don't want to trigger the WF if the previous run has failed due to some reason. For this you can use unix command "$?" or you can use "gettaskdetails" with "pmcmd" and can include the status in your "do" condition of the while loop.
NOTE this part of the code will at this position: *position*

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home