Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


jcarter7
2011-02-08T20:49:47Z
Still need "AND" logic for use with multiple triggers. For example, I want Job B to run after sucessfull completeion of Job A, but not until 11:30 pm.

So I want a trigger for 11:30 PM, AND a trigger on Job completed sucessfully.

And no, I do not want to put everything together in one job, so please don't suggest it.

Possible implementation idea: Add trigger "groups"; triggers in same group can be ANDed, multiple trigger groups in same job can be ORed (or vica-versa). This would allow flexibility for both simple or complex job triggering.
Sponsor
Forum information
ErikC
2011-02-10T08:31:15Z
Isn't this possible with the use of conditions?

If you have trigger groups, how would this be working?
I have a file trigger on create in dir A and a file create trigger in Dir B.
Whe I use your AND group, when will the job be triggered? files are created after each other so this job will not run.

The OR meganism is allready in place by using more triggers for one job.
The AND should be a condition in my opinion.

In your case, Job B could make a trigger file when it's done. Job A can check after 11:30pm if the file is there.

Regards,
Erik

Uses Visualcron since 2006.
jcarter7
2011-02-10T19:14:05Z
ErikC wrote:

Isn't this possible with the use of conditions?



Not really, that just a hack/workaround since we don't have AND triggers. And it doesn't allow multiple triggers to occur in any order.

ErikC wrote:

If you have trigger groups, how would this be working?
I have a file trigger on create in dir A and a file create trigger in Dir B.
Whe I use your AND group, when will the job be triggered? files are created after each other so this job will not run.



Once BOTH triggers are satisfied (when second file created, be it A or 😎, the job runs.

ErikC wrote:

In your case, Job B could make a trigger file when it's done. Job A can check after 11:30pm if the file is there.



You make it more complicated then it needs to be. That would require extra steps, disk storage, possible NTFS permission issues, etc. The job configuration would be unnecessarily complicated, and would have more points of failure.

"AND" triggers provide a simpler way to do this. Also, you are assuming that job A always runs before 11:30pm. With an AND trigger on Job A completed AND 11:30 pm. Job B should trigger once BOTH are satisfied.

Two examples:
1. Job A finishes at 10:00 pm. Job B waits until 11:30pm and then starts.
2. Job A finished at 11:40 pm. Job B starts immediatly after since it is already after 11:30 pm.

Just need some mechanism to know that, say if job A finishes after midnight, that this is still after 11:30 pm.
Support
2011-02-10T21:10:35Z
I wish it was as simple as AND. If AND was the only case then it would not be a big issue. What is making things more complicated is that you write "but not until 11:30". Because no such Trigger exist yet.

It had been another thing if it was just AND, for example if a file triggers and time must be more than 11:30. This you can do already now with time exceptions.

From what I understand you want VisualCron to wait for another Trigger (in this case, specific time).

What you _could_ do is to create a Wait Task where you calculate the Wait time based on current time and 11:30. Then you will actually start the Job once the file enters but the following Task after the Wait Task will not run until 11:30.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jcarter7
2011-02-10T21:33:04Z
Support wrote:

What is making things more complicated is that you write "but not until 11:30". Because no such Trigger exist yet.


But the time trigger does exist! I don't understand what you mean.

You guys are too focused and the example I chose to use and not on the functionality itself. I do not see what is so hard about it.

And event satisfies a trigger (mark that trigger as "satisfied").
If there are other AND triggers on the Job, that are not yet satisfied, the job does not run. Once all AND triggers are satisfied, the job runs. The AND triggers can be satisfied in any order, it doesn't matter.

It is common in other Scheduling servers I have used in the past (Tidal, Maestro), but is a limitation in VisualCron.
Support
2011-02-10T21:44:52Z
All I am saying is that Trigger 1 AND 2 is not a problem. What is a problem, and requires more logic, is that you want Trigger 2 has to wait for 1.

If there was a File that triggered at 11:30 then fine. That is a pure AND. But you want some kind of sliding AND where the first File trigger, which could be done at 11:10 should wait for the right time to Trigger?

Or, did I misunderstood you? Is it ok that VisualCron skips all files that were triggered before 11:30?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jcarter7
2011-02-10T22:05:30Z
No, triggers do not need to "wait". And I never mentioned anything about files, that came from ErikC. So I can't answer your question about skipping files.

Forget about waits, jobs, files, and time. Think of it like this:

Some event occurs that fires Trigger 1, then Trigger 1 is flagged as triggered/met/whatever.
If there are NO other AND triggers, run the job.
If there ARE other AND triggers, check their triggerd/met/whatever flags.
If all are set/true, run the job.
If any are NOT set/true, don't run the job.

That's it! We are not "waiting", we just did nothing (except set a flag) if there ARE other pending AND triggers.

So now assume that Trigger 1 is set/true, and there IS another AND Trigger (2) that is NOT set (so job has not run yet). Later, another event occurs that fires Trigger 2.
We see that there is one other AND Trigger (1), and that it is already set/true, so run the job.

It's simple, and stateless (except for the flags), so you don't have to acually "wait" on purpose, the wait happens more as a side-efect of the logic.
Support
2011-02-10T22:12:49Z
Ok, sorry for the misunderstanding.

But, could you give me a real world example of two Triggers that you would like to use in an AND matter? That would help us in decisions how to design this.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jcarter7
2011-02-10T22:28:18Z
I already did. But here is is again:

Triggers on Job B:
Trigger 1 - Job A completed sucessfully
Trigger 2 - 11:30

NOTE: This is just one example, there are many other scenarios where AND triggers would allow for advanced job trails, so don't get hung-up on this one example.

Basically I want one job to run after another job completes sucessfully, but NOT before a given time. Also, keep in mind that Trigger 2 can fire before Trigger 1, order does not matter (Trigger 1 could be 11:30 and Trigger 2 could be Job A, makes no difference, AND triggers are not necessarily sequential). Job runs once ALL "and" triggers have fired.

So in this example, Job B may start at 11:30 if Job A has already finished sucessfully. Or, Job A may be late, so if it finishes at say 11:50, then Job B runs immediatly afterwards (Trigger 2 - 11:30 has already fired, so is already flagged, Trigger 1 fired after Trigger 2).

Hope that is clear, I tend to overuse parenthisis to try to clarify, but I wonder if that doesn't just make it harder to read and understand sometimes. 😲
Support
2011-02-10T22:36:05Z
So, this basically means "waiting" for the other Trigger. You say "Job runs once ALL "and" triggers are failing. It is this part that makes it more complex. Currently, the way Triggers work right now is that they react right away - they do not wait on anything.

What do you think should reset this Trigger, i.e. when is it possible for the AND Triggers to fire again? Let's say Trigger A fires 5 times then Trigger B fires. So, in your case, the Job starts. Should Trigger B wait for another 4 times? Or is it reset at that moment when the Job has been run?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jcarter7
2011-02-10T22:41:53Z
BTW, I've only used a few Conditions in my jobs, mainly because we don't (yet) have AND Triggers, so I can't say this for sure, but with better triggering functionality, we may not even need Conditions! (or need them less, special circumstances).
jcarter7
2011-02-10T23:24:20Z
Support wrote:

You say "Job runs once ALL "and" triggers are failing.



You misquoted me, I said "... once ALL 'and' triggers have fired.".

You are still thinking of waiting as if it needs to be coded specifically to wait. It doesn't.

Support wrote:

Currently, the way Triggers work right now is that they react right away - they do not wait on anything.


That's fine, and they can keep working that way. Just add a "fired" flag (call it whatever you want), and add logic to set the flag for the trigger that just fired, and then before running the job, check to see if there are other triggers. If there are, and they have already "fired", the go ahead and run the job. If any have not fired, then DO NOTHING (waiting is doing something, you don't need to wait, just exit). Other "and" triggers will fire later to run the job (once all other trigger flags have "fired"). The last trigger that fires is the only one that will actually run the job.

Support wrote:

What do you think should reset this Trigger, i.e. when is it possible for the AND Triggers to fire again? Let's say Trigger A fires 5 times then Trigger B fires. So, in your case, the Job starts. Should Trigger B wait for another 4 times? Or is it reset at that moment when the Job has been run?


We could have quite a discussion about this. But for now to keep it simple, just reset the flags if the Job runs. it doesn't matter how many times a trigger fires as long as it fires at least once, it is flagged.

The only catch is: what if the job does not run at all for "today" (because one of the triggering events never occured, like in my example, Job A never ran)? The flags could interfere with the same job running in the next day (cause it to run prematurely). This is where the discussion grows, and I can tell you how it works in Tidal, but let's save that for another time. So perhaps you could add another attribute (time limit?) to a trigger so the user can indicate when a "fired" trigger should reset if the job hasn't yet run (may never run). Or this attribute could be global in nature, say a start-of-new-day time, that would clear all trigger flags? Just thinking out load now.

I welcome your thoughts...
Support
2011-02-11T00:43:41Z
Essentially we are talking about the same thing. Sleep/Wait/Flag etc. Inner workings is not that interesting, if we wait or flag or what.

Still this is very different from how it works now as we look at the current state - not previous state (if some _has_ happened). Currently we are using: "Is it firing" and you want to look at "has it been fired". As said before, it would be simple to implement Is trigger A firing AND Is Trigger B firing. But that is not what we are talking about here.

What is important is that we understand what you need. We just need to weigh this in with other things on our roadmap and to see how it fits the current design.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2012-03-29T08:49:29Z
We are interested in opening discussion for this again. We have thought about this and we want to provide the following:

1. being able to select if Triggers should be treated as AND or OR
2. be able to select a Time period between Trigger A or B or make it infinite in waiting for second Trigger.

Is it something you miss from these requirements?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2012-03-29T09:32:08Z
Here is a link to the specification. We are still working on it - please leave any comments in this post.

https://docs.google.com/...Gn7fgQjwzsFS_AsYfaE/edit 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
2012-03-29T13:39:18Z
I was thinking of the GUI. Here are some sketches.

With the Combine button you can combine selected triggers to an AND and you might want to have a popup with some options about when the triggers should reset.

The Seperate button will make from selected triggers seperate triggers so those behave as OR triggers. No popup need to be here.

I think lines showing which triggers are bind to AND are better than colored dots.

Regards,
Erik
ErikC attached the following image(s):

Uses Visualcron since 2006.
mferree
2012-03-30T01:05:52Z
This feature would be great for several jobs I'm using other work arounds right now. Thanks!
ErikC
2012-03-30T05:47:58Z
Trigger idea
It might be an idea to add two time events (or a combination of both):

  1. trigger after ....
  2. trigger before...

With a combination of these two in an AND case, you could run this in a specific window. You might make this so it can trigger each (wordk)day from 9 AM to 6 PM.

Trigger reset
When the job is triggered all the tiggers ANDs and ORs should reset to not being triggered.

Trigger wait time
The question is how long a triggered trigger should wait in an AND situation for the other trigger(s) to trigger. When making an AND there should be a popup where you can set this up. There has to be some time stuff in there. When the 1st trigger is triggered in the AND, how long should this AND wait: could be in minutes / days, but it could also be before 5PM today or infinitive. If the time window is reached, all the triggered triggers in the AND will reset.

Regards,
Erik
Uses Visualcron since 2006.
Support
2012-03-30T06:13:45Z
Originally Posted by: ErikC 

Trigger idea
It might be an idea to add two time events (or a combination of both):

  1. trigger after ....
  2. trigger before...

With a combination of these two in an AND case, you could run this in a specific window. You might make this so it can trigger each (wordk)day from 9 AM to 6 PM.

Trigger reset
When the job is triggered all the tiggers ANDs and ORs should reset to not being triggered.

Trigger wait time
The question is how long a triggered trigger should wait in an AND situation for the other trigger(s) to trigger. When making an AND there should be a popup where you can set this up. There has to be some time stuff in there. When the 1st trigger is triggered in the AND, how long should this AND wait: could be in minutes / days, but it could also be before 5PM today or infinitive. If the time window is reached, all the triggered triggers in the AND will reset.

Regards,
Erik



Thanks for the feedback and images Erik.

Functionality
- Trigger reset - I think we covered this in the image in the early specification
- Trigger wait time - yes, this is also covered. Similar popup to loop but there is no to and from, you just select the Triggers you want to have an AND dependency
- Trigger after/before. I am not sure here. This overlaps both current Time exceptions and Trigger expiration

GUI
- we will display dependency in some way, maybe through dotted colors - not decided yet. Arrows requires some more logic and we want to get this feature out.
- if it has triggered or not does not really belong to the Edit window but it could be useful to add. We are thinking that we should show a number here instead. 0 means that it has not triggered. Because it might be useful to know that Trigger 1 has trigger 5 times while Trigger 2 has not Triggered any time.

Thanks


Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
michiel.witte
2012-03-30T07:03:23Z
I've been reading this discussion and for what it's worth: I don't agree on solving the problems with introducing AND logic in the trigger mechanism.

In my opinion the problems can be solved with the correct use of conditions.
If it's not possible to solve it with existing conditions, then do something about the conditions, for example:

I can imagine the need for a job which has a file trigger but is only allowed to run between 3:00 and 5:00.
Can you please make it possible to use time as a condition?

Conditions are the right place for logic, triggers are not.

If you want to run job X at 11:30 but only when job Y is succesfully ended?
Let job Y set a variable.
Use a condition in job X to check the value of the variable.

Just my 2 cents.
Support
2012-03-30T07:08:04Z
Originally Posted by: michiel.witte 

I've been reading this discussion and for what it's worth: I don't agree on solving the problems with introducing AND logic in the trigger mechanism.

In my opinion the problems can be solved with the correct use of conditions.
If it's not possible to solve it with existing conditions, then do something about the conditions, for example:

I can imagine the need for a job which has a file trigger but is only allowed to run between 3:00 and 5:00.
Can you please make it possible to use time as a condition?

Conditions are the right place for logic, triggers are not.

If you want to run job X at 11:30 but only when job Y is succesfully ended?
Let job Y set a variable.
Use a condition in job X to check the value of the variable.

Just my 2 cents.



The problem with current situation is that you both have to work with Variables (setting) and Conditions (reading). While it is possible to solve this way this make things a whole lot more complex if you have a lot of Jobs that depend on multiple Triggers. When trying to run Jobs in parallel this becomes even more complex.

Our idea is that Conditions and Variables should not be needed at all in order to create multiple Triggers.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
2012-03-30T08:55:04Z
Hmmm Michiel..

Lets put on a different hat and let me give some negative advise on the AND / OR meganism:

A trigger is something that is hapening in a split second. Just before and after that moment there is nothing...
When the trigger happens you can take actions or not, that is a decision to make based on other 'things', things that are not triggers.
If you make AND triggers they should be there on the same split second which will not happen most of the time.
Enriching the conditions is the solution here: More checks on 'things' so we know if we need some action after a trigger fires.

My 1st reply to this post was also: why not using the conditions for this?
Sometimes the 1st thing you think of is the best...

Regards,
Erik
Uses Visualcron since 2006.
Support
2012-03-30T09:04:16Z
Originally Posted by: ErikC 

Hmmm Michiel..

Lets put on a different hat and let me give some negative advise on the AND / OR meganism:

A trigger is something that is hapening in a split second. Just before and after that moment there is nothing...
When the trigger happens you can take actions or not, that is a decision to make based on other 'things', things that are not triggers.
If you make AND triggers they should be there on the same split second which will not happen most of the time.
Enriching the conditions is the solution here: More checks on 'things' so we know if we need some action after a trigger fires.

My 1st reply to this post was also: why not using the conditions for this?
Sometimes the 1st thing you think of is the best...

Regards,
Erik



I think it is a question about original design. Conditions are global and not attached to any Job. Conditions are not lying in the background to wait for something to happen. They are more like an attribute to a Job or Task - if you have selected that.

Generally, I do not see any problems enriching Conditions but there are some things that they were not made for. Like waiting for something to happen.

Extending current Triggers, in my opinion, does not make Conditions worse in any way but just makes Triggers more flexible.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2012-04-03T08:58:26Z
Please test this new version with multiple Trigger support:

http://www.visualcron.co....aspx?g=posts&t=2370 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
2012-04-12T06:51:37Z
Hi,

I do not like the GUI for the trigger dependency.
It's not clear you have to select a trigger and setup the dependencies for this trigger. The popup window is not telling you that you are setting up the dependencies for the selected trigger.

I made a new GUI screen that does the trick and hope you will use this as the new dependency window.

Regards,
Erik
ErikC attached the following image(s):

Uses Visualcron since 2006.
Scroll to Top