Jump to content
Nikoladis

Trigger condition: generic error in expression

Recommended Posts

I have this line in the trigger condition, why does it give a generic error in expression when I run scenario?

this and (taskCompleted t1) and (taskCompleted t2) and (taskCompleted t3) and (taskCompleted t4) and (taskCompleted t5)

t1 to t5 all exist right from start. They are all tasks. The error comes both when evaluating trigger as server only or not.

Also if I try this then I get invalid number in expression:

this and ((taskState  t1 == "Succeeded") or (taskState t1 == "Canceled")) and ((taskState  t2 == "Succeeded") or (taskState  t2 == "Canceled")) and ((taskState  t3 == "Succeeded") or (taskState  t3 == "Canceled")) and ((taskState  t4 == "Succeeded") or (taskState  t4 == "Canceled")) and ((taskState  t5 == "Succeeded") or (taskState  t5 == "Canceled"))

Edited by Nikoladis

Share this post


Link to post
Share on other sites

if you put one in at a time first :

this && (taskCompleted t1)

and se if that work you can then ad another 

this && (taskCompleted t1)  && (taskCompleted t2)...

to see which one there is making the error.

  • Thanks 1

Share this post


Link to post
Share on other sites

When I do that I also get the error. Btw. the tasks are made with "create task" modules.

 

Found a workaround though:

 

this and ["t1"] call BIS_fnc_taskCompleted and ["t2"] call BIS_fnc_taskCompleted and ["t3"] call BIS_fnc_taskCompleted and ["t4"] call BIS_fnc_taskCompleted and ["t5"] call BIS_fnc_taskCompleted

  • Like 2

Share this post


Link to post
Share on other sites

i just went up to (taskcompleted t7) with no problem on a empty map just to try it out..

 

 

Share this post


Link to post
Share on other sites
this && { _x call BIS_fnc_taskState == "SUCCEEDED" }count[ "t1", "t2", "t3", "t4", "t5" ] isEqualTo 5

If you want it to fire if all the tasks where completed successfully.

 

this && { _x call BIS_fnc_taskCompleted }count[ "t1", "t2", "t3", "t4", "t5" ] isEqualTo 5

If you want it to fire if the tasks are completed no matter their state, Cancelled, Succeeded or Failed.

 

Where "t1" to "t5" are the task ID given in the createTask module.

You should not use task commands with BI's task functions/modules.

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×