As an example, let’s create a simple task that sends an email every 10 minutes.
Steps:
- Navigate to Processes > Events. Click on the New button in the menu bar to display the Event Properties window where you can create a timed event.
- Define a schedule for the event.
- In this case, run the event every 10 minutes indefinitely.
- In this case, run the event every 10 minutes indefinitely.
- In the Advanced tab of Event Properties window, select an entity type.
- Create a corresponding event action.
- Navigate to Business Logics > Actions > Event Actions and click on the New button in the menu bar to display the Event Action Properties window, where you can create a new event action.
- From the Entity field, select the entity associated with the event action (same entity as the one chosen for the timed event).
- From the Scope field, select the timed event by double-clicking on it.
- Its associated access name will then populate the Event Name field.
- Navigate to Business Logics > Actions > Event Actions and click on the New button in the menu bar to display the Event Action Properties window, where you can create a new event action.
- Attach code to the newly created event action.
- In this case, write the following code:
bpmAppService.BPMSServices.NotificationService.Send("Scheduled email", "This email was sent at " + DateTime.Now.ToString("G"), NotificationAgent.Email, true, "John.Doe@interfacing.com");
- In this case, write the following code:
- Deploy an application.
- The BPMS Scheduler exposes itself through a TCP connection port 555 to accept job changes.
- The Designer program connects to the Scheduler to create, modify, and/or delete jobs.
- Connection settings are:
- for the Scheduler in BPMSSchedulerWindowsService.exe.config file
- for the Designer in BPMS.Designer.exe.config file
- for the Scheduler in BPMSSchedulerWindowsService.exe.config file
- Connection settings are:
- The Designer program connects to the Scheduler to create, modify, and/or delete jobs.
- During deployment, the Designer attaches to the Scheduler:
- Initiated from:
BPMS.Designer.Infrastructure/Services/BPMAppService.cs/DeployTimeEvents()
- Attach to the Scheduler:
Ray.BPMS.Core/Scheduler/SchedulerService.cs/AttachToWindowsServiceScheduler()
- Sync Events:
Ray.BPMS.Core/Scheduler/SchedulerService.cs/SyncStarterProcessTimeEvents()
- Initiated from:
- The Scheduler receives the events and creates the corresponding jobs (tables ray.BPMS_QRTZ_TRIGGERS and ray.BPMS_QRTZ_SIMPLE_TRIGGERS)
- The BPMS Scheduler exposes itself through a TCP connection port 555 to accept job changes.