ActivityStep workflow step

An ActivityStep is similar an AutoStep Workflow Step, except that it can use any of the branch types—including a TRIGGER or a TIMEOUT—to move to the next step. However, before an ActivityStep branches to the next step, it waits for one or more activities to complete. PolicyCenter indicates the termination of an activity by marking it one of the following:

  • Completed (which includes either being approved or rejected)
  • Skipped
  • Canceled

Activities are a convenient way to send messages and questions asynchronously to users who might not even be logged into the application.

The Workflows editor indicates an activity step with a person icon in the box the represents that step.


Person icon.

Within an ActivityStep, you specify one or more activities. The workflow creates each defined activity as it enters the step. (This occurs immediately after the workflow executes the Enter Script block, if there is one.) The activity is available on all steps.

The only difference between an Activity and a Notification within a workflow is that:

  • An Activity pauses the workflow until all the activities in the step terminate.
  • A Notification does not block the workflow from continuing.

If more than one Activity exists on an ActivityStep, then the workflow generates all of them immediately after the Enter block (along with any events or notifications). The step then waits for all of the activities to terminate. If desired, an ActivityStep can also contain TIMEOUT and TRIGGER branches as well. In that case, if a timeout or a trigger on the step occurs, then the workflow does not wait for all the activities to complete before leaving the step.

After PolicyCenter marks all the activities as completed, skipped or canceled, the ActivityStep uses one or more GO branches to proceed to the next step. There can be any number of GO branches that leave an activity step. As with AutoStep Workflow Step, the workflow evaluates each GO condition, and chooses the first one that evaluates to true. If none evaluate to true, the workflow takes the branch with no condition attached to it.

Notice that it is possible for the condition statement of a GO branch to reference a generated Activity by its logical name. For instance, it is possible that you want to proceed to a different step depending on whether PolicyCenter marks the Activity as completed or canceled.

Create an activity workflow step

Procedure

  1. Right-click in the workflow workspace, and select New ActivityStep.
  2. The dialog contains the following fields:

    Field

    Description

    Step ID

    The ID of the step to create.

    Name

    Name of the activity.

    Pattern

    Activity pattern code. This must be a valid activity pattern as defined through Guidewire PolicyCenter.

    ID

    ID of a branch leaving this step. It defaults to the To value if you do not supply a value.

    To

    ID of the step to which the workflow goes if the condition specified for this branch evaluates to true.

  3. Click on your newly created step and open the Activities tab at the bottom of the screen. After you create the ActivityStep, you need to create one or more activities. (Each ActivityStep must contain at least one defined activity.) These fields on the Activities tab have the following meanings:

    Name

    Name of the activity.

    Pattern

    Activity pattern code value. This must be a valid activity pattern code as defined through Guidewire PolicyCenter. To view a list of valid activity pattern codes, view the ActivityPattern typelist. Only enter a value in the Pattern field that appears on this typelist. For example:

    • approval
    • approvaldenied
    • general
    • ...

    Init

    Gosu code that the workflow executes immediately after it creates the activity. Typically, you use this code to assign the activity. If you do not explicitly assign the activity, the workflow auto-assigns the activity. For example, the following initialization Gosu code creates an activity and assigns it SomeUser in ­SomeGroup.

    Workflow.initActivity(Activity)

    Activity.autoAssign(SomeGroup, SomeUser)

    The initialization code creates an activity based on the activity pattern that you set in the Pattern field.