Pass variable from one Job to another one.

Eduardo Menezes (20 posts)
October 5, 2022 04:29 AM
Accepted Answer

I have one JOB A that has a response to call another JOB B.

Is it possible to have one variable on the JOB A that I can read it from JOB B?

If yes, can some one help how to configure it?

This topic has an accepted answer. Jump to it.
Bill Staff (599 posts)
October 5, 2022 09:26 AM
Accepted Answer

When you edit the Job Control Actions, there is a Variables tab where you can set variables to be passed to the target job.

Any variables that get created or set in the calling job using a script, variable update task, or variable update action are automatically sent to the target job.

If you have a variable named MyVariable in Job A and you want its value passed to Job B, you need to set it up as follows:

  • In Job B, define a variable named MyVariable. It can have an empty value
  • In Job A, define the the MyVariable variable and set it to the appropriate value for Job A
  • When you edit the Job Control Action in Job A that runs Job B, you will see MyVariable on the list, showing the value that is defined for it in Job B.
  • Edit the variable here and set its value to "%MyVariable%" (without the quotes). This tells adTempus to set the variable in Job B to the current value from Job A when the action executes.

Eduardo Menezes (20 posts)
October 31, 2022 11:49 AM
Accepted Answer

Thank you very much Bill.

As always, you guys help me a lot.

Eduardo Menezes (20 posts)
March 21, 2024 11:07 AM
Accepted Answer

Hello Bill,

 

Resuming the old topic...

 

I have another Job C that is called by the Job B, which received the original value calculated by Job A.

 

It's working from Job A to Job B, but the Job C is not receiving the correct value.

 

Have you seen this happening?

 

Is there any limitation once the value was originally calculated on Job A?

 

Thanks in advance.

Bill Staff (599 posts)
March 22, 2024 09:34 AM
Accepted Answer

If you are using adTempus 4.x it should work the same way as the original scenario: you need to define the variable in Job C and then configure the Response in Job B to pass the value.

If you are using adTempus 5.x that should still work but there is also a new way to specify which variables should be passed between jobs.