Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
9 subscribers
Views
3912 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Completing a list of taskids using loop
redae
over 8 years ago
Hi,
Inside saveInto of my sail form - Is it possible to call a!completeTask within an apply loop ?
apply( a!completeTask , listOfTasksIds , {}, {}, {})
I have the following error when I try to :
An error occurred while executing a save: java.lang.IllegalStateException: Non-Save Reactions should be unwrapped individually and not processed as a list
Cheers
OriginalPostID-258540
Discussion posts and replies are publicly visible
0
Jim Schweitzer
Certified Lead Developer
over 8 years ago
Might try building a process model that loops through your complete task items using the smart service and then use a!startprocess in your SAIL code and pass the taskids as a param
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Raviteja Varma Jampana
A Score Level 2
over 8 years ago
We can evaluate Smart Service Functions on success/failure of Smart Service Functions. So building an expression or recursive rule with proper exit conditions which result a structure like this would work.
a!completeTask(
taskId: taskId[1],
onSuccess: {
.../*recursive*/a!completeTask(
taskId: taskId[2],
onSuccess: {/*So On*/}
)
}
)
However this is not advisable as it is going to take more time and recursion may cause chaos sometimes. As others suggested best solution will be start an asynchronous process which takes multiple task Ids as input and cancel them all.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
redae
over 8 years ago
@jim419 : thank - yes will probably go with that option. @ravitejavj: thanks - interesting possibility but cumbersome indeed. will go with jim suggestion.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jim Schweitzer
Certified Lead Developer
over 8 years ago
@redae, cool just remember a!startProcess is async, so you can't expect a response to be passed back into your SAIL
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
redae
over 8 years ago
@jims419 - Right ! Actually I did use subprocesses with spawn list that are triggered after my task because of those missing callbacks indeed.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel