(Example) Configure the Update Process Data Activity

This example shows how to configure the Update Process Data activity to change the values of a specified process data variable.

Background and Setup

To change the values for your process data variable, do the procedure in this topic.

Video: Add Conditions and Salesforce Actions

Video: Configuring Process Data

Good to Know

  • The Update Process Data activity was frequently used in AgilePoint BPMS 5.x, which did not have many of the features for managing data and variables that now come out-of-the-box with AgilePoint NX. These include eForms, Data Entities, and many process activities that connect with third-party technologies. In older AgilePoint products, the Update Process Data activity was often used to set or change values in the process schema.

    In AgilePoint NX, the Update Process Data activity is usually used in exception cases when data values can not be set any other way. In other words, this activity is still used in many NX apps, but the best practice is to use this activity as a final option, rather than the default.

How to Start

  1. Open Process Builder.

    For information about how to open this screen, refer to Process Builder.


    Open Process Builder
  2. In the Process Builder, in the Activity Library, open the Common tab.

    Open Common tab
  3. On the Common tab, drag the Update Process Data activity onto your process.

    Drag Update Process Data activity
  4. Complete the fields on the General Configuration screen.
  5. Click Next.
  6. On the Update Custom Attributes screen, click the App Data tab.

    Update Custom Attributes screen
  7. On the App Data tab, in the Model Data, click Edit Edit icon.

    Process Data tab
  8. On the Data Model screen, right-click processFields and click Element.

    Data Model screen
  9. In the Element Name field, enter PersonResponsible.

    Data Model screen
  10. Click OK.

Example 1: Variable in the Expression field

This example shows how to use a variable in the Expression field.

Procedure

  1. On the Update Custom Attributes screen, in the Process Data Variable field, drag PersonResponsible.

    Update Custom Attributes screen
  2. In the Expression field, drag ProcessInitiator.

    Update Custom Attributes screen
  3. Click Validate Validate icon

    Update Custom Attributes screen

    This creates C# code that looks like this:


    Update Custom Attributes screen

Result

After the process completes, you can view the result in Manage Center on the Process Detail screen > Data tab > Form Variable tab.

The variable PersonResponsible stores the current value of the ProcessInitiator when the Update Process Data activity runs.


Form Variable tab

Example 2: Literal Value in the Expression field

This example shows how to use a literal string value in the Expression field.

Procedure

  1. On the Update Custom Attributes screen, in the Process Data Variable field, drag PersonResponsible.

    Update Custom Attributes screen
  2. In the Expression field, enter "Mary Poppins".

    The string value must be enclosed within the quotation marks (" ").


    Update Custom Attributes screen
  3. Click Validate Validate icon.

    Update Custom Attributes screen

    This creates C# code that looks like this:


    Update Custom Attributes screen

Result

After the process completes, you can view the result in Manage Center on the Process Detail screen > Data tab > Form Variable tab.

The PersonResponsible variable stores the value Mary Poppins from the Expression field.


Form Variable tab

Example 3: C# Code Snippet in the Expression field

This example shows how to convert the values of employee1 (Poppins) and employee2 (Van Dyke) to all capital letters and combines both values with the word "and".

Procedure

  1. On the Update Custom Attributes screen, in the Process Data Variable field, drag PersonResponsible.

    Update Custom Attributes screen
  2. In the Expression field, enter the expression in this format.

    Format:

    ([Drag the Employee1 variable from Form Data]).ToString().ToUpper() + " and " +([Drag the Employee2 variable from Form Data]).ToString().ToUpper()

    Example:

    (${/pd:AP/pd:formFields/pd:Employee1}).ToString().ToUpper() + " and " +(${/pd:AP/pd:formFields/pd:Employee2}).ToString().ToUpper()

    The Employee1 and Employee2 are form fields in the form.


    Update Custom Attributes screen
  3. Click Validate Validate icon.

    Update Custom Attributes screen

    This creates C# code that looks like this:


    Update Custom Attributes screen

Result

After the process completes, you can view the result in Manage Center on the Process Detail screen > Data tab > Form Variable tab.

The values of Employee1 (Poppins) and Employee2 (Van Dyke) are converted to all capital letters. It also combines both values with the word "and". This is the result: POPPINS and VAN DYKE.


Inline Functions Result