Trigger's own state property is overriden (or shadowed) by the required state of the job it will trigger on.
So it is impossible to rely on the trigger's own state (for example to trigger on it with another trigger).
Though I found that it is possible to reflect the real trigger's state via the state:mirror job.
Am I correct? Is such behaviour worth fixing (i.e. making the properties separate)?
I am using Oddjob 1.4.0.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I post here my solution to "how to trigger on another trigger".
Is there a problem? Might not be a problem. May be just a kind of misunderstanding how to accomplish it another way.
The job that is set to be triggered might not be triggered at all (the trigger is canceled).
The job's state will not change so we can not watch for the job.
The trigger can potentially reflect the state of the job after it has ran for some time.
But the trigger's state will not tell us if it was canceled. It becomes COMPLETE: so the job was not ran and the trigger is COMPLETE.
Might be a slight semantic misalignment. (The <check> job has similar..)
How to continue processing in an event-driven style?
Suppose there is a trigger (FileUnzipTrigger) that will run a job (FileUnzipJob)
<scheduling:triggerid="FileUnzipTrigger"name="on Updated | {$path}/{$file}"on="${FileUpdateFlag}"state="COMPLETE"cancelWhen="FINISHED"><job><sequentialid="FileUnzipJob"name="Unzip {$what} from {$file}"><jobs><mkdirname="Make Directory"dir="C:/Files/{$unZipPath}/"/><execname="Unzip File"dir="C:/Files/{$unZipPath}/">7z e ../"{$file}" "{$what}" -y
<stdout><stdout/></stdout><stderr><stderr/></stderr></exec></jobs></sequential></job></scheduling:trigger>
A job can be created to serve as a boolean flag and other jobs further in processing line can be set to watch for this job instead.
Hi, Rob. Your solution is good. Because everything about the trigger is in one branch. Thank you.
I also find a good point in mine such that a set of such flags (if there are many) will visually (V/X) indicate which events processed which not. While a set of triggers themselves will visually (V/X) indicate if there were any errors, because in the current Oddjob implementation only INCOMLETE or EXCEPTION states will propagate up to the trigger, which is also kind of useful.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Trigger's own state property is overriden (or shadowed) by the required state of the job it will trigger on.
So it is impossible to rely on the trigger's own state (for example to trigger on it with another trigger).
Though I found that it is possible to reflect the real trigger's state via the state:mirror job.
Am I correct? Is such behaviour worth fixing (i.e. making the properties separate)?
I am using Oddjob 1.4.0.
I post here my solution to "how to trigger on another trigger".
Is there a problem? Might not be a problem. May be just a kind of misunderstanding how to accomplish it another way.
The job that is set to be triggered might not be triggered at all (the trigger is canceled).
The job's state will not change so we can not watch for the job.
The trigger can potentially reflect the state of the job after it has ran for some time.
But the trigger's state will not tell us if it was canceled. It becomes COMPLETE: so the job was not ran and the trigger is COMPLETE.
Might be a slight semantic misalignment. (The <check> job has similar..)
How to continue processing in an event-driven style?
Suppose there is a trigger (FileUnzipTrigger) that will run a job (FileUnzipJob)
A job can be created to serve as a boolean flag and other jobs further in processing line can be set to watch for this job instead.
Hi - yes, this isn't easy. I will change Trigger state to INCOMPLETE when cancelled which will make this easier.
My solution is below, but it is no more elegant than yours.
Hope it helps,
Rob.
Last edit: Rob Gordon 2016-05-09
Hi, Rob. Your solution is good. Because everything about the trigger is in one branch. Thank you.
I also find a good point in mine such that a set of such flags (if there are many) will visually (V/X) indicate which events processed which not. While a set of triggers themselves will visually (V/X) indicate if there were any errors, because in the current Oddjob implementation only INCOMLETE or EXCEPTION states will propagate up to the trigger, which is also kind of useful.