Want to Minimize the Script Node number.

Hey All.

I have requirement to manipulate the process variables receiving in process model as a parameter. I am using 3 script task node to manipulate the PV ,as the output of 1st node is using in 2nd node and output of 2nd in 3rd node.  Can I minimize that? Because I want that the  process model takes very less time to execute(performance should be good).

See the below scenario:

1st Script Task Node:-  Expression= cond(pv!a)     Output:- pv!op1

2nd Script Task Node:- Expression= cond(cond(pv!op1))     Output:- pv!op2

3rd Script Task Node:- Expression= rule!ABC(cond(pv!op2,cond(pv!op3)))     Output:- pv!op3

 

Thanks in advance

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    I agree with @Mike and @Mohamed and adding to that, in case if you have requirement to store all three in PV then in such case return dictionary as output of your rule like:


    {
    firstpv: your data,
    secondpv: your data,
    thirdpv: your data
    }

    While calling this rule in process , use todatasubset(rule!myRule(....)) And store this in a process variable of type datasubset, now while parsing and storing it into separate pv's you can do following:

    pv!firstpv-> index(pv!datasubset.data, "firstpv", {})

    Similarly for rest of the PV.

    Hope it will be helpful
Reply
  • 0
    Certified Lead Developer
    I agree with @Mike and @Mohamed and adding to that, in case if you have requirement to store all three in PV then in such case return dictionary as output of your rule like:


    {
    firstpv: your data,
    secondpv: your data,
    thirdpv: your data
    }

    While calling this rule in process , use todatasubset(rule!myRule(....)) And store this in a process variable of type datasubset, now while parsing and storing it into separate pv's you can do following:

    pv!firstpv-> index(pv!datasubset.data, "firstpv", {})

    Similarly for rest of the PV.

    Hope it will be helpful
Children