Vikas
Vikas

Reputation: 5

How to Rerun the Failed Sessions Alone in a Workflow

I have a WF which contains say 10 sessions. But only 6 out of 10 sessions got succeeded, when i ran the WF. I need to run only the failed 4 sessions when i run the WF again, i shouldn't rerun the succeeded sessions. Please suggest to me how to achieve this.

NOTE: I AM USING THE SQLSERVER AS SOURCE AND ORACLE AS TARGET.

The same thread/Question is already present with some details not understanding properly

I tried the following

a) Define a parameter Restart_indicator (It can have 2 values 'Y' in Restart Situation, 'N' otherwise.

Que : How to give 2 values to the parameter (Parameter & variable in MAPPING Tool Bar)

b) Define a Run Table where work-flow name + session name will be the key. c) At the start of workflow run initialize all entries associated with that work flow when Restart_indicator = 'N' d) every time a session executes successfully , update the Run table entry for that workflow session combination. e) For every session have a conditional execution the condition being i) Restart_indicator = 'N' or Restart_indicator = 'Y' and Run_table entry for workflow session indicates that the session has not completed successfully.

QUE: How to define the conditional execution to begin the failed session to re-start? please elaborate this little bit.

Thanks

Upvotes: 0

Views: 2574

Answers (1)

vmachan
vmachan

Reputation: 1682

This post on YouTube gives a good explanation of how to conditionally start a session.

In your case, you would need to

  1. create a workflow variable for each of the 10 sessions, make these persistent and initialize to 0

  2. create a task after each session that updates it's corresponding workflow variable and set it's value to 1, this task should run only if the session completes successfully without error.

  3. Before the session starts, you need to add a condition that checks that it's workflow variable is 0, only then start it.

  4. In addition, you would need to add a task in the beginning of the workflow that would check all the 10 workflow variables (1 for each session) and if all are 1, then set all to 0. This will ensure that the next time you run the workflow it will start, even if all sessions completed successfully the previous time.

Hope this helps.

Upvotes: 1

Related Questions