2.4.2 Executing a process when one of multiple conditions is satisfied (example of defining a jobnet that uses an OR job)
Use an OR job when defining a jobnet in which a process is performed when one of multiple conditions is satisfied.
In the example below, an OR job is used to define a jobnet that monitors the system for 10 minutes for receipt of a JP1 event. If the JP1 event is received, the succeeding job is executed immediately. If the JP1 event is still not received after 10 minutes, the succeeding job is executed at that point.
|
Only event jobs can be defined as the preceding jobs of an OR job. In this example, we want to watch for a JP1 event to be received, so we define a Receive JP1 event job. We use an Interval control job to monitor for elapse of the 10-minute time period, and define the wait time as 10 minutes.
If any event monitored by the event job defined as the preceding job of an OR job occurs, the succeeding job is executed, and other event jobs stop monitoring events and enter the Bypassed status. Thus, in this example, once the event being monitored by the Receive JP1 event job is received, the Interval control job stops monitoring for the interval to elapse. At completion of the succeeding job that was triggered by event reception, the jobnet also ends.
When the succeeding job performs an end judgment on the return value of the OR job, the OR job's return value is the same as the return value of the event job executed as the preceding job.
- Cautionary notes
-
-
If execution of an event job is stopped, the event job enters the Not sched. to exe. status. Thereafter, when the preceding job of the event job terminates, the status of the event job changes from Not sched. to exe. to Bypassed, and the succeeding OR job is executed.
If the status of an event job has changed to Killed or Ended abnormally because of killing a jobnet or a timeout, other event jobs also stop monitoring events and enter the Bypassed status. In this case, however, the OR job is not executed because the preceding job of the OR job includes the abnormally terminated event job.
-
When you restart execution from the event job defined as the first or second preceding job of an OR job, check whether the preceding jobs include an event job that has been terminated and placed in the Bypassed status. If there is such an event job, the OR job is executed immediately after the restart. In this situation, if, for example, you want the event job to monitor events, place all event jobs that directly precede the OR job in the Ended abnormally status. Then, re-execute the root jobnet with From abnormally ended job selected in Rerun Method.
-