Index from scriptask output

Hi everyone, 

I have a scriptask which create an output of type text by running an expression rule, which looks like below: 

I save this output into a process parameter, then plan to use it for the sub-process. 

 If I want to take the updatedRelationship of the current process instance, what the script should be like? 

I tried below code but the data does not pass into sub-process... do I need tp!instanceIndex for the process to know what data to pass into its subprocess?

index(pv!scriptaskOutcome,"updatedRelationships",tp!instanceIndex, null)

Thank you!

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Chris

    After selecting the "Automatically run multiple instances of this node" option you have to define how many instances of this subprocess will have to run. In the expression editor next to the "Run this many" option you have to insert the following piece of code:

    count(
      index(
        pv!scriptaskOutcome,
        "updatedRelationships",
        "entityId",
        null
      )
    )

    I'm using count() function and not length() because it's counting the null values also of the entityId