As an example, let’s create a simple task that sends an email every 10 minutes.

Steps:

  1. 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.
  2. Define a schedule for the event.
    • In this case, run the event every 10 minutes indefinitely.
  3. In the Advanced tab of Event Properties window, select an entity type.

  4. 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.
  5. 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");
  1. 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:
          1. for the Scheduler in BPMSSchedulerWindowsService.exe.config file
          2. for the Designer in BPMS.Designer.exe.config file
    • 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()
    • The Scheduler receives the events and creates the corresponding jobs (tables ray.BPMS_QRTZ_TRIGGERS and ray.BPMS_QRTZ_SIMPLE_TRIGGERS)