Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

Every process needs a trigger to start the process. In Job Stream, Events are created with Out Conditions and can be used as In Conditions to trigger the next process. But there is some scope for Events through which process can be executed. 

The Events are accessible for today with In Condition <event_name>and events created before the period are not accessible by any JobStream.  

Types of Events

There are three types of Events available in the Job Stream. 

  1. Event Consumed in the same workflow.
  2. Event Consumed in a different workflow.
  3. Event Consumed in a different master

Event Consumed in the same workflow

The events exist in the session until the Job Stream is not completed. A Job Stream starts and creates a new instance of Job Stream identified by a random ID called the session ID. The events created in an instance can be consumed by In Condition in this instance.

If the <eventA> is created in InstanceA and InstanceB than the <eventA> differently for both the instances.

If the events are used as <eventA> in any In Condition of the JobStream then it searches for an <eventA> in the current instance. 

Event Consumed in a different workflow.

If the event is used in In condition <JobStream_name.event_name> then it searches for an event created today by any session of the Job Stream. e.g. If you create two Job Stream JobStreamA and JobStreamB. And you want to use the event created JobStreamA to start the execution of JobStreamB you have to address the Job Stream name in the In Condition  e.g <JobStreamA.eventA>

Event Consumed in a different master.

The scope of events between different master is also called as Global events. The events are accessible in multiple JobScheduler within the same database. Once the Global Event is created we can use it as an In Condition and Out Condition of the same or different JobScheduler masters. To automatically start one JobScheduler's Workflow(Job Stream) with the conditions of another JobScheduler master then we can use Global Events as an In and Out Conditions

Refer to the article on Global Events for details.

Status
subtletrue
colourGreen
titleFEATURE AVAILABILITY STARTING FROM RELEASE 1.13.4

The global events can be accessed using the expression <global:event_name> if created today. If you want to use the events which are created before the period can be accessed using the condition e.g. global:event1[yesterday]. This condition evaluates to true if the global event was created yesterday.

Period for Event

The 24 hour period is now configurable according to the requirements and the working hours. Users can select the begin-time for the period. To set the begin-time of the period, edit the scheduler.xml file from the $SCHEDULER_DATA/config folder, and add the parameter sos.jobstream_period_begin for the start time of the period. If you didn't add the value for the parameter sos.jobstream_period_begin by default it takes 00:00:00 to 24:00:00 in UTC.

The syntax for parameter: 

Code Block
 <param name="sos.jobstream_period_begin" value="08:00"/>

The above parameter accepts only the UTC timezone. So, if the parameter is set with the value 08:00 UTC then the period begins from 13:30 IST and the next period is started after 24 hours. 


Note: Whenever expression <event[today]> is used in any In Condition and Out Condition it takes the period mention in the scheduler.xml.


The period referred to the time up to which the event is accessible using the expression <event_name> in the In Condition and Out Condition. The default value for the period is 00:00:00 to 24:00:00 UTC 

How to access the events which are in a period

The events by default, when used the expression as <eventname>, search for the event in the period. If the event exists in the period then only it evaluates to true otherwise the conditions become false. 

So, the expression <eventname> is same as <event[today]> and it searches for the event in the current period.

With release 1.13.4 the new object is added called session. When the expression <eventname> is used in a Job Stream and the if starter starts the job it creates a session. Now, this expression evaluates to true only if the event was earlier created by the same session.

How to access events which are not in a period

The events can be accessed using the In Conditions expressions if they are not in period. Some examples of the expressions are:

  1. event[today]: Search for the events created in the period.
  2. event1[yesterday]: Search for the events created yesterday.
  3. event1[month.day_of_month]:  Search for the events created on the day of the month e.g event1[4.28]: search for the event created on 28'April.
  4. event1[yesterday-3]: The expression calculates the value 3 days before yesterday.

If the two events are created with the same name in the Job Stream and In Condition is used as event1[today] then it will search for an event in the latest available session of the Job Stream.