Update Process Data activity

An activity that updates the values of specified process variables.


Update Process Data activity

Change Variable Values

To change the values for your variables, do the procedure in this topic.

Video: Add Conditions and Salesforce Actions

Video: Configuring Process Data

Examples

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.

  • In most text fields, you can use process data variables as an alternative to literal data values.
  • This section shows the configuration settings on the configuration screens for this activity. Other configuration settings apply to system activities. For more information, refer to:
  • You can configure whether this activity waits for other activities before it runs.

    For more information, refer to How Do I Configure an Activity to Wait for Other Incoming Activities?

How to Start

  1. Open Process Builder.

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


    Open Process Builder
  2. In 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

Procedure

  1. Complete the fields on the General Configuration screen.
  2. Click Update Custom Attributes Update Custom Attributes icon
  3. Set process data variables whose values you want to change a variable on the Update Custom Attributes screen.
  4. (Optional) Click Advanced Advanced icon > Email Notifications E-mail Notifications icon.

    For more information, refer to Email Notifications screen (Process Activities).

General Configuration

Specifies the basic settings for the Update Process Data activity.

Figure: General Configuration screen

General Configuration screen

Fields

Field NameDefinition

Display Name

Description:
Specifies the activity name that shows in your process.
Allowed Values:
One line of text (a string).

Accepted:

  • Letters
  • Numbers
  • Spaces
Default Value:
None
Accepts Variables:
No
Example:
This is a common configuration field that is used in many examples. Refer to:
  • Examples - Step-by-step use case examples, information about what types of examples are provided in the AgilePoint NX Product Documentation, and other resources where you can find more examples.

Description

Description:
Specifies an optional text description for your activity.
Allowed Values:
More than one line of text.
Default Value:
None
Accepts Variables:
No

Update Custom Attributes

Connects process data variables to C# code snippets to update the variable values.

Figure: Update Custom Attributes screen

Update Custom Attributes screen

Fields

Field NameDefinition

Add Add icon

Function:
Adds a new process data variable.

Validate Validate icon

Function:
Compiles the code snippet to validate the variables, and displays an error message if necessary.

Delete Delete icon

Function:
Deletes the selected row from the variable list.

Edit Edit icon

Function:
Changes the process data variable.

Process Data Variable

Description:
Specifies the name of the process data variable that stores the return value for your code snippet.
Allowed Values:
  • A process attribute.

    At runtime, if the process attribute does not exist, a new variable is created and the value is assigned.

  • An Xpath to an XML schema element.

    At runtime, if the schema element does not exist, the process ignores the action. If you want to change a repeatable XML element, make sure it exists in the process schema.

Default Value:
None
Accepts Variables:
Yes
Example:
  • Process attribute variable - EmployeeName
  • XML process variable - /pd:myFields/pd:empName

Also refer to:

Expression

Description:
Specifies a value your code snippet gives to the process data variable.

The Expression field can not be blank.

Allowed Values:
Behind the scenes, the value in the Expression field is converted to complete this C# phrase:

ds["/pd:AP/pd:formFields/pd:message"] = dsNew["/pd:AP/pd:formFields/pd:message"] = {Expression field value};

As such, it is possible to have several different types of values, but in most cases, they must follow C# syntax.

You can use any of the types of values in this list.

A literal string value.

  • The string value must be enclosed within the quotation marks (" ").
  • The string must be in valid C# string format, which means no special characters that would cause the string to be misinterpreted as C# code.

Examples:

  • "Mary Poppins"
  • "8675309"

Behind the scenes, this creates C# code that looks like this:

ds["/pd:AP/pd:formFields/pd:message"] = dsNew["/pd:AP/pd:formFields/pd:message"] = "8675309";

A variable.

If you use a variable in the Expression field, it initializes, or sets, the value of the variable in the Process Data Variable field to the current value of the variable in the Expression field when the Update Process Data activity runs.

  • You can use process data variables in either of these formats:
    • Process data - ${EmployeeName}
    • Xpath - ${/pd:myFields/pd:empName}
  • Do not enclose variables with quotation marks (" ").

Behind the scenes, this creates C# code that looks like this:

ds["/pd:AP/pd:formFields/pd:message"] = dsNew["/pd:AP/pd:formFields/pd:message"] = ds.Attr("/pd:AP/pd:myFields/pd:empName", pi, w);

A C# code snippet.

This is advanced functionality, and knowledge of the C# programming language is required. AgilePoint does not provide detailed documentation on how to use C# code in general. These are rules to understand if you already know how to program with C#. If you would like help with this feature, please contact AgilePoint Professional Services.

  • Any .NET methods must be available in one of these namespaces:
    • System
    • System.Collections
    • Ascentn.Workflow.Base
  • If you use variables in the C# snippet, they must obey these rules:
    • You can use either AgilePoint formatting or standard C# formatting.

      For example, you can use the format ${EmployeeName} or ds.Attr("EmployeeName", pi, w);

      The same as when you use only a variable in the Expression field, if you use the AgilePoint variable format, it is converted to C# format behind the scenes.

    • Your C# code must use type casting for the variables.

Example:

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

In this example, the values of employee1 (Poppins) and employee2 (Van Dyke) are converted to all capital letters (UPPER CASE). It also combines both values with the word "and". This is the result: POPPINS and VAN DYKE.

Behind the scenes, this creates C# code that looks like this:

ds["/pd:AP/pd:formFields/pd:message"] = 
dsNew["/pd:AP/pd:formFields/pd:message"] 
= ds["/pd:AP/pd:formFields/pd:message"] = 
dsNew["/pd:AP/pd:formFields/pd:message"] 
= (ds.Attr("/pd:AP/pd:formFields/pd:employee1", 
pi, w)).ToString().ToUpper() 
+ " and " 
+(ds.Attr("/pd:AP/pd:formFields/pd:employee2", 
pi, w)).ToString().ToUpper();
Default Value:
None
Accepts Variables:
Yes
Example:
Refer to: