Skip to main content
Known Participant
Feb 6, 2024 6:09 PM UTC
Question

Loop in process model

Need a loop for multiple texts. To test the loop just made a dummy loop like below

Start node:
Process variables : array(Text, multiple, {"a","b", "c"}), iteration (Number, Integer),  len(Number Integer)

Set len :
Set output: expression: = length(array), stored to: pv!len 

Properties: Delete after execution

XOR:
=pv!iteration>pv!len true End NOde
Else: Text Doc From Template

Text Doc From Template
save a document

named: pv!iteraion

description: pv!iteration & array

Properties: Delete after execution

Increase Iteration:
Set output: expression: = pv!iteration+1, stored to: pv!iteraion 
Properties: Delete after execution

But I can see the it stuck at XOR after 1st iteration. Why?
Let me know if you want more info.

2 replies

stefanhelzle0001
Brainy
Feb 6, 2024 6:56 PM UTC

An XOR with multiple inputs used in a loop will stop at the second iteration. That is by design. Add an empty script task before the XOR and merge your flows in that one.

Some tips on looping: https://docs.appian.com/suite/help/23.4/looping.html

abhayd3663
Brainy
Feb 6, 2024 7:10 PM UTC

Create a script task before XOR and redirect increase iteration to that script task. Alternatively you may use existing 'set len' also.