Skip to main content
swapnar6405
Known Participant
Nov 17, 2022 4:20 PM UTC
Solved

Process, sub-process

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.

    harshj0001
    Inspiring
    Nov 18, 2022 11:59 AM UTC

    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
    Nov 17, 2022 5:41 PM UTC

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

    swapnar6405
    Known Participant
    Nov 18, 2022 1:55 AM UTC

    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
    Nov 18, 2022 7:15 AM UTC
    harshj0001
    Inspiring
    Nov 18, 2022 11:59 AM UTC

    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
    Known Participant
    Nov 22, 2022 8:05 PM UTC

    Great help. Thanks for helping with example.

    Appreciated your hehp.

    stefanhelzle0001
    Brainy
    Nov 22, 2022 8:43 PM UTC

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