IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Modeling events > Understanding and using undercover agents

Create an undercover agent for a scheduled event

Follow these steps to create an undercover agent that invokes a service as the result of an event that occurs on a regular schedule.

Scheduled undercover agents do not run on the Process Center Server unless you click Run Now. If you are testing a BPD that includes scheduled undercover agents, and you want to ensure that the undercover agents run on time, run the BPD on a Process Server in one of your runtime environments such as your staging or testing environment.


Procedure

  1. Start IBM Process Designer and open the appropriate process application in the Designer view.

  2. In the Designer view, select the plus (+) sign next to Implementation and then select Undercover Agent from the list.

  3. In the New Undercover Agent window, enter the following information:

    • Name: Type a name for the new undercover agent.
    • Schedule Type: Select Time Elapsed from the drop-down list.

    • Click Finish.

  4. In the Common section, you can type a description of the undercover agent in the Documentation text box.

  5. In the Scheduler section, you can see the type of schedule for the current undercover agent. After you have configured and saved the undercover agent, you can click Run Now if you want to test the undercover agent and monitor it as described in Maintaining and monitoring IBM BPM Event Manager.
  6. Under Details, click the drop-down list next to Queue Name to select the queue that you want from the following options:

    Available queue options
    Option Description
    Async Queue Allows Event Manager jobs to run at the same time.
    SYNC_QUEUE_1 Forces one job to finish before the next job can start. By default, three synchronous queues are available.
    SYNC_QUEUE_2 Forces one job to finish before the next job can start. By default, three synchronous queues are available.
    SYNC_QUEUE_3 Forces one job to finish before the next job can start. By default, three synchronous queues are available.

    For more information about Event Manager jobs, monitoring those jobs, and creating and maintaining Event Manager execution queues, see Maintaining and monitoring IBM BPM Event Manager. When install and run the process on a Process Server in a test or production environment, the queue that you select must exist in that environment in order for the undercover agent to run.

  7. Ensure the service shown as the Attached Service is the one that you want to invoke according to the specified schedule.

    If not, click Select to choose a different service.

  8. Ensure that the Enabled check box is checked/enabled.

    If this check box is not enabled, the undercover agent will not run.

  9. In the Parameter Mapping section, click the Use Default check box if you want to use the default value of the input variable in the attached service. If the input variable of the attached service does not have a default value, this check box is disabled.

    Type a value in the text box if you want to manually map a constant value to the input variable of the attached service.

    For example, you might use a constant for testing purposes.

  10. Scroll down to the Time Schedule section and use the available options to establish a schedule.

    For example, if you want to start the attached service every week day at midnight, use the Ctrl key to select the options that are selected in the following image:

    You can select multiple contiguous items by pressing the Shift key, clicking the first in the series, and then clicking the last in the series. To select multiple non-contiguous items, press the Ctrl key each time you click an item.

    The On the hour value is selected by default in the last column of the Time Schedule section.

    If you clear this selection and you do not make any other selection in the column, the On the hour value will be used even though it is not selected.

  11. Open the BPD that includes the message event to which you want to attach the undercover agent.

    For example, if you want a particular process to start at the same time each day, you can associate the Start Message Event in the BPD with an undercover agent that establishes the required schedule.

  12. Click the message event in the BPD to select it.

  13. Click the Implementation option in the properties.

  14. In the Message Trigger section, click Select next to Attached UCA and select the undercover agent created in the previous steps.

Understanding and using undercover agents