What I've noticed when using Maestro, and I don't think that I can account that as a bug, is that the AND task waits for all previous tasks to finish. After that it accepts and goes on to the next task. However, I expected (and hoped) that it was not just a gathering of tasks, but also in a more technical sense an AND operator on the previous tasks. The attached image might explain a bit better the situation I am currently referring to.
What I would expect (and propose) as the result of the AND operator would be the minimum state of all previous tasks that finished. So if one was "Success" and the other "Cancel", I would expect the AND operator to go on to the next state with "Cancel" (or reject) as it's state. This would save me the trouble of creating two variables while allowing the branches to converge before doing the requested test.

CommentFileSizeAuthor
#1 solution.png24.85 KB_randy
create_ifWf.png61.43 KBRSpliet

Comments

_randy’s picture

StatusFileSize
new24.85 KB

Sorry for the (very) late response on this item. However I've been thinking about this item for quite some time and I am having trouble seeing how this could fit in to Maestro without creating a new AND task type and somehow have the task type make the assumption that all tasks feeding in to it are the ones that will set status and the task immediately following it is an IF task. Seems very specific to your use case.

The workflow you've shown above can easily be tailored to work in Maestro without any changes by using 2 process variables to track the status of the tasks that were completed.
Immediately after your acknowledge task 1 and acknowledge task 2, you would have and IF task under each of those. The IF tasks would test to see if the last task is status is success or not. If they are successful, the IF points to a set process variable task that sets one of the 2 process variables to whatever you'd like (true, 1, yes etc).
Else, the IF points to another set process variable task that sets one of the 2 process variables to the opposite.
THis way you've now trapped the status in variables and you can test those variables for success anywhere in the flow.

RSpliet’s picture

First of all thank you for your solution. I'm glad I'm able to implement it when required!
However, looking at those arrows does give the suggestion of a dreadful process. The solution I had in mind comes down to extending the current AND process. At the moment it's "return value" passed on to the next stage is always "succeeded" (or accepted, or well, sth. similar). I would propose to change this return value, if possible, to the minimum of all incoming branches. Forgive me for not remembering the exact terminology of these status codes, but in the line of: if one incoming branch is rejected, and the other accepted, the status that the AND process propagates to the next block would be "rejected". It does proceed, but with a negative response, just as any rejected task would.
For legacy workflows I don't see a negative impact here, as there is no need to rely on the return value of the AND process right now. Are there problems you foresee with this approach?

_randy’s picture

I understand your approach -- however consider if the tasks directly preceding the AND task are tasks that do not set any status information... they just execute.

The AND in your approach would have to assume that the tasks directly preceding it are the ones who will set the status of the AND. There are also a few status conditions as well. What is the ANDing conditions that need to happen?

Here are the task status options:

 CONST STATUS_CANCELED = -3;
 CONST STATUS_DELETED = -2;
 CONST STATUS_ON_HOLD = -1;
 CONST STATUS_READY = 0;
 CONST STATUS_COMPLETE = 1;
 CONST STATUS_ABORTED = 2;
 CONST STATUS_IF_CONDITION_FALSE = 3;

What are we to do when one branch is canceled, one is completed, one is aborted and one is false?

gaurish’s picture

Issue summary: View changes

In batch function task(dummy or) what i need to select in order to pass the value to if task.
I tried creating same flow but its not working

_randy’s picture

@gaurish You don't pass anything to the IF. The IF checks the status of the last task's execution and that's it.

_randy’s picture

Status: Active » Closed (works as designed)