Condition Set - Match any but not all - VisualCron - Forum

Community forum

On tasks where I need to evaluate for multiple conditions and I need the task to Match All, I'm finding that I can't use a condition set because the On Match Any is causing problems. Since I need my task to match all conditions, no matter how I set the On Match Any, it causes the wrong action to occur.

The problem as I see it is that Match Any is a subset of Match All, so what ever I say should happen in Match Any is also happening when it matches all.

If I say to exit or go to an error handling task when any are met, it will exit when all are met too, which is not correct. If I tell it to continue or go forward in any way are met, that's not correct either since it did not match all, which is what I require.

I understand the good use of On Match Any, but it just gets in the way in the situation where I want the task to exit unless all conditions are met. I would like to create one condition set with multiple conditions, and be able to prescribe an action when some but not all conditions are met.

So ideally
I would like to be able to just not test for "On Match Any"
Choose between On Match or On Not Match Any depending on the logic I'm trying for
Have a check box on On Match Any that indicates "but not all"
Have step through logic for On Match Any that says if first condition matches or doesn't match do X, then go on to the next condition etc..

Note: just figured out that I can't create multiple conditions for a single task without a condition set, so without that as an option a new feature seems like my only way out..
You should use On match all if you have multiple Conditions that needs to be met inside one Condition set.
Please like  VisualCron on facebook!
I am definitely using "On Match All", the issue is that you have to pick an action for all four match conditions, and as far as I can tell, any action I pick for "On Match Any" creates incorrect logic for my needs.

The condition I'm trying to create needs to check that there is distinctly one (and only one) of five specifically named (with date appended) required files existing in a directory before proceeding.

The action choices available for "On Match Any" (and the other 3 match states) are as follows:

•Wait - wait a specified time (always available)
•Continue - Run Task or Job if match (default value for On Match All and On Match Any)
•Next - Run next Task in queue (skip current)
•Retry - Wait specified time and re-run current Task
•Exit - Exit current Job (default value for On Match None and On Match Error)
•Run Job - Run specified Job (exits existing Job, runs specified Job)
•Run Task - Run specified Task in current Job, after completion it continues with next in order

None of those actions are correct.. I only want to prescribe an action based on the "On Match All", "On Match None" or "On Match Error" state. If there were the ability to pick N/A, ie not apply any logic for "On Match Any", I would be golden.. but I'm broken as long as I have to pick some kind of action for all 4 conditions.

It would also be incredibly helpful if in the Actions section, in addition to prescribing actions for match states, if there were a selection to throw an error (or not) based on if a condition were true or false.

My workaround for both issues has been to have a step that counts files, and a condition on the next step that counts the output from the previous list step, and that continues if the file count = 5, or if the count <> 5, it goes to an email step which I placed as an orphaned task at the end of the job to notify the SA and DBA for the action on "On Match None" or "On Match Error".

Two deficits with this workaround are:
  • I know there are 5 files, but I have not verified that they are the correct files, that there is one and only one of each file
    Neither the job, nor any task, actually log the failure to meet the condition.

Looking for helpful more robust workarounds and/or hearing if there are others that would appreciate this type of functionality enhancement.
If you use the On Match Any with Next and the On Match All with Continue and use the same condition on all the upcomming tasks, can that be a solution?

Uses Visualcron since 2006.
Thanks for your reply ErikC,

If I'm understanding this flow, the Next option jumps the current task and goes to the next task, so I think your suggestion would work if I broke this up in to a task for each file validation, however that is what I'm trying to avoid. Right now I only have a handful of distinct file names I have to validate for, however that list is going to grow, and my vCron jobs will become exponentially larger as we continue to develop this type of workflow.

I really feel that there should be an option to go to next condition in the set, and if any condition fails, then be able to pick a workflow (exit, stop the job, fail the job etc).

Below are some ways I could see meeting this need:

* In the Condition SET Actions section, in addition to prescribing actions for Match Any/All/None states, if there were a selection for prescribing an action for
"Match SOME but not ALL"

* An option within each condition UI itself to add a Condition Action

* A step through option in Condition Sets UI that shows each condition and asks for each if condition 1 is true/false go to next condition or fail the task, if
condition 2 is true/false go to next condition or fail the task etc.

* If there were an On Match False option in the Condition Set Actions UI that meant if any single condition is false, then do a specific action. This is different than On match Any because On Match Any measures if any succeeded, On Match False would measure if any did not succeed.

* Have the ability to select more than one condition set (each with it's own Actions prescribed) on a single task, and test for all of the condition sets selected

I don't see that vCron has a workaround for this problem other than creating an exponential growth of single purpose validation tasks for each file name that needs to be validated which would become unsupportable very quickly. I really believe this should hit your enhancement/new feature radar if possible.


Hi ErikC (and any future users that have this issue).

While I still believe an enhancement would be useful, I think I just found the work around.

List Files Task that outputs the file list (used in the next step to count that there are 5 files)
Condition Set on List Files Tasks that has 5 conditions, each one looking for a FALSE condition for that file name.
If Match Any or Match All - go to a task that notifies stakeholders and skips over the rest of the tasks in that job (no error, but does not proceed, and notifies which is not as good but will do in a pinch)
If Match none - continue

If none of the conditions in the Condition set were false we go to the next task. That task has a condition set that first checks the file count using a variable from the List Files Task, or could use previous task variable
Value 1: Variable {TASK(c9d4042d-6b55-4387-8ae9-db48cee08e32,Result.NoFiles)}
Type: Int32 Equals (=)
Value 2: 5
If that is not true, then
If Match Any or Match All - Continue
If Match none - go to a task that notifies stakeholders and skips over the rest of the tasks in that job (no error, but does not proceed, and notifies which is not as good but will do in a pinch)

The first condition set validates that there is at least one file of each "flavor", but there may be more than one of each flavor, which is why the second condition set checks for a count of 5

This is a work around, the biggest issue is that it does not fail the job or track an error. Which is why we still need a feature enhancement.
Scroll to Top