Setting variables in pre and post assignments

You can set pre and post assignments for variables when you want to assign a value to a variable immediately before or after an activity or event runs.

Before you begin

To perform this task, you must be in the IBM® Process Designer desktop editor.

About this task

You can set pre and post assignments for components in a service, such as a Coach or a Server Script component.

For example, if you want to send an email message to end users as soon as an activity is active and can be completed, you can attach a timer event to the activity and use a post assignment to place the task ID into a variable so that it can be passed to the follow-on activity that sends the email message. The task ID is needed so that the email message sent to end users includes information about the task to complete. You can achieve this by using a post-assignment.

Procedure

  1. Open the Process Designer desktop editor.
  2. Open a business process definition (BPD) that includes an activity or event that requires a pre assignment or a post assignment.
  3. Click the activity or event in the BPD diagram and then select the Pre & Post option in the properties.
  4. To add an assignment, click the Add assignment icon (green plus sign) in either the Pre Assignments section or the Post Assignments section.
  5. In the field on the left, click the variable icon to choose a variable that you have declared in the current BPD that will receive the value.
  6. In the field on the right, type the variable name that will be used as value for the variable in the left field.
    Tip: You can type any existing variable name. Use the type-ahead feature to select your variable, you do not have to limit yourself to local variables.

    When you set a pre or post assignment for an activity, the activity in the BPD diagram includes a circular indicator on the left side (pre assignment) or on the right side (post assignment).