Completing a list of taskids using loop

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

Parents
  • 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.
Reply
  • 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.
Children
No Data