Skip to main content
June 1, 2021
Question

How to return multiple values from an ER in a Script task ?

  • June 1, 2021
  • 4 replies
  • 0 views

Hi,

I have created an Expression Rule that returns 3 values (for example).

a!localvariable(
  ...,
  
  {
    value1: local!myValue1,
    value2: local!myValue2,
    value3: local!myValue3
  }
)

When I call my ER inside an Interface, I do not have any problem to get the 3 data (ex : rule!myRule().value1).

But how would you do it inside a Script Task from a Process model ? because when I call my ER I can only set the result into a single Target.

Maybe is there any way to do it with a Map, or any other solution ?

(obviously I could use a CDT but it would be used only for this case in the whole application, so maybe it might be a good pratice to not create this CDT just for a single using. Or maybe, the good practice would be to use imperatively a CDT ? ;-)  )

Regards 

  

4 replies

stefanhelzle0001
Brainy
June 1, 2021

Use a map(). A PV can be of map type.

June 1, 2021

Thank you Stefan.

and after having stored it, do I just have to use a XOR condiction like this ?

if(pv.mymapvalue("value1") = 1 ...

stefanhelzle0001
Brainy
June 1, 2021

It would be pv!mymapvalue.value1