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.
Usually this activity is used to prevent a subprocess from acessing data from a parent process. When a value is set in a Set Scoped Variable activity, the value is
protected or "hidden" within the scope until the Get Scoped Variable is called to pass
the scoped data to a variable that can be used in other activities or eForms in the process.
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:
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
Set Scoped Variables
Specifies the information to set the scope for one or more variables.
Any scope that is used represents a unique ID that can be passed from the Set Scoped
Variables activity to the Get Scoped Variables activity. All of these options are simply different types of IDs.
The different ID options are provided for convenience or to match your business requirements. For example,
you could use Process Instance ID for one Set Scoped Variables activity and
Activity Instance ID for
another Set Scoped Variables activity in the same process model. This would provide the option of two different
automatically generated IDs. However, there is no difference in the functionality between the two ID types.
To values for the scoped variable, you must select the same ID type in the Get Scoped Variables activity.
For more information, refer toGet Scoped Variables activity.
Allowed Values:
A scope from the list.
Process Instance ID - Uses the current process instance ID to set the scope for the variable.
As a best practice, it is recommended to use this option only if you have only one
Set Scoped Variables activity in a process.
All Set Scoped Variables activities configured to use Process Instance ID will have the same associated ID.
Activity Instance ID - Uses the activity instance ID for the current
Set Scoped Variable activity to set the scope for the scoped variable.
Generate New GUID - Creates a custom scope ID in GUID format to
set the scope for the variable.
One line of text (a string)
that represents a unique scope name.
Default Value:
None
Accepts Variables:
Yes
Add
Function:
Adds a row for the Variable and Expression fields.
Validate
Function:
Makes sure the value specified in the Expression field is correct, and shows the error message if an error occurs.
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:
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: