Skip to main content
swapnar6405
November 17, 2022
Solved

Process, sub-process

  • November 17, 2022
  • 6 replies
  • 0 views

Hi,

I have a dictionary and I am passing the same into a sub-process and it is running n-number of times based on the count (n) of items in the dictionary.

Now, in the sub-process I need to pass each item to a rule and get the data.

How can I get each individual item from the dictionary. Will there be any counter which will get increased whenever sub-process was running.

Thanks.

    Best answer by harshj0001

    Hi swapnar6405,

    what i understood by your statement that want to apply loop on a sub-process based on length of some process variable. You can refer the given example for this.
    use case - i want to copy the images in the folder.

    Node (length of document)—find the number of items in the pv.
    node (copy document)—now copy the document in the folder by index you have got from the first node.

             also decrement the index by 1 in the output of the 2nd node (copy document)

    XOR - now check if the index is zero the end the process else continue.


    length of document node-

    copy document node 

    xor node 

    Hope it will help.

    6 replies

    stefanhelzle0001
    Brainy
    November 17, 2022

    You can use tp!instanceIndex to pass individual items to your sub process.

    swapnar6405
    November 18, 2022

    Hi,

    I have a process model along with a sub-process.

    In the above defined main process model, I have a script task called "List of Submitters".

    My script task is loading 3 different values in a variable called "listOfSubmitters".

    Now, when I need to pass each individual value to the sub-process.

    How can I get individual values of the variable "listOfSubmitters" in the sub-process?

    I am not getting where and how to use tp!instanceIndex.

    stefanhelzle0001
    Brainy
    November 18, 2022
    harshj0001
    November 18, 2022

    Hi swapnar6405,

    what i understood by your statement that want to apply loop on a sub-process based on length of some process variable. You can refer the given example for this.
    use case - i want to copy the images in the folder.

    Node (length of document)—find the number of items in the pv.
    node (copy document)—now copy the document in the folder by index you have got from the first node.

             also decrement the index by 1 in the output of the 2nd node (copy document)

    XOR - now check if the index is zero the end the process else continue.


    length of document node-

    copy document node 

    xor node 

    Hope it will help.

    swapnar6405
    November 22, 2022

    Great help. Thanks for helping with example.

    Appreciated your hehp.

    stefanhelzle0001
    Brainy
    November 22, 2022

    I hope you do not need to delete many documents. While this solution works, it scales very badly.