You are on page 1of 4

How to Execute single Workflow in a Job.

srinivas panala 27 posts since Mar 29, 2016


How to Execute single Workflow in a Job. Jul 4, 2016 1:54 PM
Hello,
I have 2 Jobs :
1.Job_10_Test (Full Load)
2.Job_20_Test,(Delta)

I have to Execute the Job_10_Test for Full Load,


In Job_20_Test for Delta,and for delta I only run the Job_20_Test.
My Target Tables are same in Job_10_Test and Job_20_Test,and I'm Just Appending the Delta Records to the
same Full load Table in Job_20_Test
So
In Job_20_Test I have 3 workflows ,
My requirement is..
If I execute Job_10_Test, then in my Job_20_Test only the 3rd Workflow should execute or else If I'm
executing only Job_20_Test the Job should execute normally..
If any Suggest me in this it would a good help.
Regards,
P.srinivas

Ravi kiran Pagidi 191 posts since May 27, 2016


Re: How to Execute single Workflow in a Job. Jul 4, 2016 2:54 PM
Hi Srinivas,
You have to use Conditional object to achieve this.
Suppose you have 3 work flows. so take 3 conditional objects and take these 3 workflows in the 1st branch of
conditional and in the 2nd branch take a script and print a message like print('no load happens');
in the if condition of that conditional object give a variable $G_CONDITION=$G_VALUE1

Generated by Jive on 2016-08-30Z


1

How to Execute single Workflow in a Job.

initialize $G_CONDITION='Y' and G_VALUE1='N'


Now the conditions fails and the workflow doesn't run and only the script in the 2nd branch will run.
in order to make it run you have to make $G_VALUE='Y' to pass the condition.
so design your script and job accordingly to achieve this.
If you have control tables which stores job run statistics information you can achieve this a bit easily.
Or you can try this.
in the 1st branch of this conditional object take only the 3rd workflow and in the 2nd branch take all the 3
workflows connecting serially.
Now if the job_10_test completes successfully then you make if condition true, so only the workflow that is in
the 1st branch runs. when you run only this job then 2nd branch with all 3 workflows should run..
Now it all depends on how you initialize variables to achieve this.
Please let me know if this works or you need more information.

Thanks,
Ravi kiran.

Santosh G. 121 posts since Apr 22, 2014


Re: How to Execute single Workflow in a Job. Jul 4, 2016 4:38 PM
Hi Srinivas,
Query - If I execute Job_10_Test, then in my Job_20_Test only the 3rd Workflow should execute or else
If I'm executing only Job_20_Test the Job should execute normally..
What I would suggest is 1. Create a separate Template table(Job_log_table) to store the job execution history of first job Job_10_Test
in Job1.
i.e.
When the job Job_10_Test executes successfully make an entry in the Job_log_table with values Job name,
Timestamp and the execution status(you can set it to successful or unsuccessful).
2. Take a separate script in the Job_20_Test and fire a sql command below -

Generated by Jive on 2016-08-30Z


2

How to Execute single Workflow in a Job.

$GV_Job_status = sql( Datastore_name, 'select status, max(time_stamp) from Job_log_table where job_name
= 'Job_10_Test' and status = 'successful'') // Modify your query accordingly
3. Take a conditional If $GV_Job_status is set then
//in the true section add only the Third_DF
Execute Third_DF
else
//Put all three DFs in the else section
Execute First_DF, Second_DF, Third_DF
Note : If you are executing Full_load job multiple times then you can change your sql query accordingly and
select the latest entry based on the Timestamp.
Regards - Santosh G.

Murali Krishna 94 posts since May 28, 2015


Re: How to Execute single Workflow in a Job. Jul 5, 2016 8:33 AM
Hi Srinivas,
If you are using BODS 4.2 version. we have a "Bypass" option. You can apply Bypass option which workflow's
you don't want execute. I never used this option but I am sure it will work.
Thanks
Murali

Ravi kiran Pagidi 191 posts since May 27, 2016


Re: How to Execute single Workflow in a Job. Jul 5, 2016 9:40 AM
Hi Murali,
Bypass feature is only for testing purpose. But the requirement here is different.

He should be able to skip the workflows execution automatically depending on the previous job execution.
Thanks,
Ravi kiran.

Generated by Jive on 2016-08-30Z


3

How to Execute single Workflow in a Job.

srinivas panala 27 posts since Mar 29, 2016


Re: How to Execute single Workflow in a Job. Jul 5, 2016 10:13 AM
HI Murali,
I should execute skip the workflow only when the successful completion of 1st job.Else I have have to execute
normally.
@ Ravi kiran Pagidi
I have used the conditional Objects and Control Table with Job status..It working Fine
Thanks for your response
Regards ,
P.Srinivas

Ravi kiran Pagidi 191 posts since May 27, 2016


Re: How to Execute single Workflow in a Job. Jul 5, 2016 11:09 AM
Hi srinivas,
Please close this thread if this has resolved your issue.

It will be useful for other members

Thanks,
Ravi kiran.

Generated by Jive on 2016-08-30Z


4

You might also like