Raghav Rao
Raghav Rao

Reputation: 43

Set a parameter in a parameter file and use it in a same workflow

I have a requirement to set a parameter say a timestamp in a parameter file using a command task that triggers a Unix shell script that does this task in a workflow and later in the same workflow, use the parameter that is set earlier. Is that possible? The informatica version used is 9.6

Upvotes: 0

Views: 3839

Answers (3)

prashant sugara
prashant sugara

Reputation: 321

You can use the Assignment task for this purpose. Set a workflow variable and use it wherever you want in the same workflow.

Upvotes: 0

Maciejg
Maciejg

Reputation: 3353

You need to define the Parameter file property on a Session. Not just set the parameter value for a session, but make the session read the paramfile.

With Workflow parmeter file it works like this (briefly speaking):

  1. Workflow is initialized and reads the assigned parameter file. All variables are set.
  2. Upon session initialization all the variables and parameters are already set .

The file is not read again, variables are not re-set.

However, once a parameter file is defined as Session property, it works in a bit different way.

  1. Workflow is initialized and reads the assigned parameter file. All variables are set.
  2. Session is initialized, and it reads its own parameter file, setting all variables and parameters.

In this case, the values defined in session parameter file will be used.

Of course, it is not necessary to use Workflow level parameter file.

It is also possible to have one session that generates the parameter file for the very next session to use it. Provided it is defined as session property, as mentioned above.

Upvotes: 1

Raghav Rao
Raghav Rao

Reputation: 43

I got the solution :). Dont know if there is any other option. But the trick that worked for me is, if you have to set a parameter and then read back the parameter to use it in the same workflow sue to whatever requirement, then you can set the parameter and then use it in a session inside a worklet, and this perfectly works. I am not sure why but this definitely works :)

Upvotes: 0

Related Questions