Tuesday 4 March 2014

Scenario 7: How to achieve daily load and weekly load through single workflow?



Scenario 7: How to achieve daily load and weekly load through single workflow?

Ex: If I have two sessions SCD1 and SCD2 in single workflow and I want to run only SCD1 on daily basis and only SCD2 on weekly basis.

Theory/Analysis:
We have to control execution pipeline based upon workflow run means if workflow is running first time then SCD1 and when workflow is running 7th time then SCD2.
Yes, You are correct we need workflow variable. Ah!!! Now it's too simple. Let's try it practically

Practically:

Step 1:
Create Worklfow Varaible
Worklfow Menu-->Edit-->Variables
 Name                         Datatype                Persistent
$$WKF_RUN            Integer                    Check (Check box should be Checked)

Set Default Value = 1

Step 2:
Create Decision Task
Develop expression like below
MOD($$WKF_RUN,7)=0

Step 3:
Drop your session SCD 1 and SCD2 create two concurrent link from decision task to both sessions. (See image below)

Step 4:
Now develop Link condition for both link
Link1--> (SCD1)=$Decision.Condition=FALSE
Link2--> (SCD2)=$Decision.Condition=TRUE

Step 5:
Create Assignment Task
Develop Expression
User Define Variable              Operator                   Expression
$$WKF_RUN                            =                            $$WKF_RUN + 1

Step 6:
Once again we need to develop two link condition for link which are coming from SCD1 and SCD2 to Assignment Task.
Link1-->$S_SCD1.PrevTaskStatus=Succeeded
Link2-->$S_SCD2.PrevTaskStatus=Succeeded

Step 8: It's a very important step (Set Treat Input Links as "OR") You will find this option in general tab.
Assignment Task-->Right Click-->Edit-->General Tab

What are you waiting for? :-) Run it analyse it....

BINGO!!!


Feel free to post your doubt in comment section.

Due to limitation, I can't attach exported .xml file which you can Import in your repository and see or analyse. (Feel free to mail me if you need .xml file with Scenario number and Question.)

If you like the approach and solution feel free to share with others.

Thanks.

hpandey.harsh@gmail.com

1 comment:

  1. Hi All,

    I have a scenario related to above scenario.... if a session failed for continuously 3 time and after third attempt it supposed to send mail....
    the catch after 3rd failure only need to send mail using email task

    ReplyDelete