Вы находитесь на странице: 1из 8

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. Hi Suman, 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* Let me know if you still have any doubts..

Saturday, March 12, 2011


Calling an informatica workflow in a loop - Part 1
Issue Description: We had an informatica workflow which had a flat file as source. We could have more than one file available at one time to be loaded. The files had to be processed individually by the workflow. Issue Resolution: Two batch scripts were created. The first (See Script One below) one had to ensure that only one file was picked up by the workflow at one time. The script is such that the number of files allowed to be processed simultaneously was passed as parameter to the script. Also, it ensured that zero bytes file were not processed by the informatica workflow if we so desired. The second batch script (See Script Two in Part 2 of this post) called the workflow in a loop. This script has other features such as: error checks and detection of status of workflow from previous run. Script One: :: :: Project : Self-Development :: Purpose : Checks number of files and file size before they are processed by interface :: Author : allispossibleteam :: Date Started : 31 August 2010 :: Date Completed: 31 August 2010 :: Usage : checkFileSize.bat INTERFACE_CODE MAX_NUM_OF_FILES ::

@ ECHO on SetLocal EnableDelayedExpansion

:: :: Interface code received as parameter one :: SET INTERFACE_CODE=%1

:: :: MAX number of files allowed to be interfaced comes as parameter 2 :: SET MAX_NUM_FILES_ALLOWED=%2

:: :: Flag to indicate if we want to check number of files being interfaced :: SET CHECK_NUM_OF_FILES=Y

:: :: Path containing source files ::

SET TGTDIR=xxx\%INTERFACE_CODE%

:: :: Flag to indicate if we want to fail interface if zero byte file is found :: SET FAIL_ON_ZERO_BYTE_FILE=Y

SET FILE_COUNTER=0 SET FILE_SIZE=0 SET ZERO_FILE_SIZE_FOUND=N

for %%a in (%TGTDIR%\*%INTERFACE_CODE%*.*) do ( for %%b in ("%%a") do ( SET FILE_SIZE=%%~zb SET /a FILE_COUNTER=!FILE_COUNTER!+1 ) IF !FILE_SIZE!==0 ( SET ZERO_FILE_SIZE_FOUND=Y ) ) :: :: NO NEED TO CHECK, NO FILES IN FOLDER ::

IF %FILE_COUNTER%==0 ( GOTO END_OF_SCRIPT )

IF %FAIL_ON_ZERO_BYTE_FILE%==Y ( IF %ZERO_FILE_SIZE_FOUND%==Y ( @ECHO FAILED DUE TO ZERO BYTE FILE SIZE GOTO CAUSE_ERROR ) )

IF %CHECK_NUM_OF_FILES%==Y ( IF %FILE_COUNTER% GTR %MAX_NUM_FILES_ALLOWED% ( @ECHO FAILED DUE TO NUM OF FILES EXCEEDING MAX GOTO CAUSE_ERROR ) ) :END_OF_SCRIPT EXIT /B 0

:CAUSE_ERROR EXIT /B 1 Posted by allispossibleteam

The block solution to loop a workflow/mapping consists of the following components: A. Control table: This table has at a minimum two columns, one column stores the value based on which looping has to be performed which in our case is Dept_ID. The second column specifies if the row has been processed. DEPT_ID 101 102 B. Parent workflow: This workflow consists of a mapping which determines if the there are any rows left in the control table that have to be processed. If yes then it calls the child workflow else it creates an indicator file which signals the end of the loop. C. Child workflow: This workflow contains the mapping which needs to be looped as per the requirement. The mapping also updates the control table to flag the row which it is currently processing. Both the workflow contains command task which call each other using pmcmd with NOWAIT parameter. The values in the control table have to be reset prior to process. PROCESSED X

Вам также может понравиться