(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
- Open Process Builder.
For information about how to open this screen, refer to Process Builder.
- In Process Builder, in the Activity Library, open the Common tab.
- On the Common tab, drag the Update Process Data activity onto your process.
- Complete the fields on the General Configuration screen.
- Click Next.
- On the Update Custom Attributes screen, click the App Data tab.
- On the App Data tab, in the Model Data, click Edit .
- On the Data Model screen, right-click processFields and click Element.
- In the Element Name field, enter PersonResponsible.
- Click OK.
Example 1: Variable in the Expression field
This example shows how to use a variable in the Expression field.
Procedure
- On the Update Custom Attributes screen, in the Process Data Variable field, drag PersonResponsible.
- In the Expression field, drag ProcessInitiator.
- Click Validate
This creates C# code that looks like this:
Result
After the process completes, you can view the result in Manage Center on the Process Detail > Data > Form Variable tab.
The variable PersonResponsible stores the current value of the ProcessInitiator when the Update Process Data activity runs.
Example 2: Literal Value in the Expression field
This example shows how to use a literal string value in the Expression field.
Procedure
- On the Update Custom Attributes screen, in the Process Data Variable field, drag PersonResponsible.
- In the Expression field, enter "Mary Poppins".
The string value must be enclosed within the quotation marks (" ").
- Click Validate .
This creates C# code that looks like this:
Result
After the process completes, you can view the result in Manage Center on the Process Detail > Data > Form Variable tab.
The PersonResponsible variable stores the value Mary Poppins from the Expression field.
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
- On the Update Custom Attributes screen, in the Process Data Variable field, drag PersonResponsible.
- 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.
- Click Validate .
This creates C# code that looks like this:
Result
After the process completes, you can view the result in Manage Center on the Process Detail > Data > 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.