set the value of a process variable in an expression

Certified Associate Developer

Hello community,

is it possible to set/change the value of a process variable in a scripttask/expression for example when a condition is true other than node output is stored as.

I know how to set a value of a processvariable in the node output, but can it be done in like setting the value of a localvariable?
example:
if(pv!fruit="Apple",
pv!color:"green",
""
)

Kind Regars,

Erik

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Mike Schmitt

    Hello Mike,

    What I am trying to accomplish is to set the value of multiple pv's based on the value of 1 other pv. Then the values of the multiple pv's will be used/configured in the doc from template service. 
    No I configured one expression for each pv separately in the nodeouput of a scriptask to save the value. So wanted to know if it is possible to update all the pv's in one expression.

    Kind Regards,

    Erik

  • 0
    Certified Lead Developer
    in reply to erikb0001

    Ah i see.  No, the way you've done it is the correct way.  I've wished at times for the ability to update multiple PVs based on one expression (such as an expression that runs an expensive calculation, and i want to just run it once and save various aspects of the result to different PVs).  The only real alternative here is to run the expensive operation in an input variable (which sucks since input variable expressions STILL collapse the expression code they contain down to one line, upon saving...), then refer to that ACP in the different output expressions.  But even this still does require one output entry added for each PV you want to write into.