Difference between Variables and Parameters?

Hi all,

I was wondering what is the difference between Variables and Parameters?
I used to use variables in my Workflow and Global Variables in Jobs, and didn’t use at all parameters, but this may be an error… so I’m looking for your input !

Thanks in advance for your help!

Kind regards


cedrickb :fr: (BOB member since 2005-08-19)

It’s more a style preference. Some of us are old school and global variables are icky things and we are used to passing parameters. I like using parameters as it make it possible to reuse and object easier since my job may not have the same global variables defined as some other developer uses.

When an object uses parameters I can test it independently by plugging it into a generic job and then specify the parameters. If instead, the object uses globals then I have to add the globals to the generic job.


eganjp :us: (BOB member since 2007-09-12)

Thanks Jim for your reply!

I agree with you, Parameter is more efficient if I want to reuse objects. but what is the difference between Global Variables and Variables? Are variables define in the object level (for exemple in a WF)?
or are Global Variables and Variables quite the same things, defined in the job level??


cedrickb :fr: (BOB member since 2005-08-19)

Variables only have scope within the object they are created in. So if you create a variable in a Workflow then only the script, conditional and while within that Workflow have access to the variable. That variable can of course be passed as a parameter to any object (Dataflow, Workflow) within that Workflow.

Global variables have scope throughout the entire job and ANY object used within the job has access to the global variable.

Really, the only difference between variable and global variables is scope.


eganjp :us: (BOB member since 2007-09-12)

that’s what I thought!

Thanks for your input !!


cedrickb :fr: (BOB member since 2005-08-19)

Can someone explain the difference between parameters of type Input, Output and Input/Output?

(this might be amateur question :P) If I define a variable of type Output(at dataflow or workflow level)…does that mean I cannot assign a new value to that variable using a script?- (I understand this part when creating a function)


avbo (BOB member since 2012-03-16)

Output means that you do expect that value of the variable to change within object it is used in. The new value will be an output from the object.

For example, you define variable $L_Fee (input/output) within the scope of Workflow WF_Process_Fee. The job makes a call to WF_Process_Fee and it uses the value returned by WF_Process_Fee to perform some other task.

Note that while parameters within Dataflows can be defined as input, output and input/output the only one that really works is input. A Dataflow will never pass a value back through the parameters. If you pass a value of 10 into a parameter and something within the Dataflow changes the value, it won’t matter. The value of the parameter when the Dataflow is complete will still be 10. That’s just the way Dataflows work through DS 4.2.


eganjp :us: (BOB member since 2007-09-12)

Thanks for your reply.

Please help me understand the below.

So, if a workflow WF1 (where I’ve defined three parameters A:input B:input/output C:Output and initialized them to zero ) has two dataflows df1 and df2.

Say, if I’ve changed the values A,B,C in the first data flow(df1) using a function.(for example A= 12, B=13, C=18)

Which of the three parameters would hold the new changed values once the DF2 starts to run?


avbo (BOB member since 2012-03-16)

None of the parameters would be changed by DF1. OUTPUT parameters do not work with Dataflows. I have done extensive research and tried to work around that issue and it just won’t work.


eganjp :us: (BOB member since 2007-09-12)