.NET method action
Use a .NET method action to:
-
Call an API for performing actions such as creating a new job, case, job in case, and retrieving job properties. You can call multiple versions of .NET methods without having to write any code.
-
Perform an action by using the data supplied and returning new data. For example, the CalculateCreditScore method is used to pass in a customer's account details and return the customer's credit score rating.
When you add a .NET action using a simple class as input and/or output parameters, all public members/properties within the selected class object appear at design time.
The .NET method action supports the following:
-
Formats for form data: Simple data types such as String, Integer, Short, or GUID. For example, the CalculateCreditScore method returns a customer's credit score (data type Short), which can be mapped to a text box to populate the credit score.
-
Controls/form variables (except form variable array) to map to the members/properties of a simple class:
-
Label
-
Textbox
-
Dropdown (the selected value)
-
Check box
-
Hyperlink
-
Calendar
-
Radio button
-
-
Supports the following controls/form variables to map to the members/properties of a complex class:
-
Form Variable Array
-
Table
-
Dropdown
-
At design time,
-
For a simple class, do not map fields or members to the simple class itself; instead, map each field individually to each form control
-
For a complex class, map the sub-members to each complex class' property individually.
-
On the form modeling bar, select
Actions and then select
New.
The New action dialog box is displayed.
- On the Type list, select .Net method.
- Change the default Name (DotNetMethod1) to something meaningful.
- Optional. Enter a Description for the action.
- Optional. To allow this action to support different behavior for different languages, select Multilingual. See Configure multilingual actions for more information.
-
Select
Configure.
The Configure .Net action dialog box is displayed.
-
On the
Assembly file path list, select
Local or
Store and select the assembly file path. For
Store, you can also select a packaged assembly (ZIP).
- The ZIP must match the name of the primary assembly inside it. For example, MyLibrary.zip must contain MyLibrary.dll. If no matching DLL is found, an error message is displayed, and the ZIP cannot be uploaded.
-
The Package Zip Max Size (MB) and Package Max Files settings in the Streaming tab of the Configuration Utility control the ZIP size and the number of files allowed in the ZIP. Refer to the Tungsten TotalAgility Configuration Utility Guide for more information.
The associated parameters are displayed, and the methods associated with the selected .NET assembly appear on the Class list and Method list.
If a .NET Core assembly is selected, its version number is displayed. For example, Version .Net 6.
-
If the selected .NET assembly is a signed assembly from the Global Assembly Centre (GAC),
Load assembly using full name is selected by default.
The Load assembly using full name option is only available if you select a local assembly for Assembly file path.
- On the Class list, select the required class.
- On the Method list, select a method that accepts a class as an input or output parameter.
-
For each parameter, map the form control, form variable or global variable using dynamic or static values.
If a parameter type contains a question mark (for example, Boolean?), it indicates the parameter is nullable.
-
To configure the DataSet, do one of the following:
-
Select a Table control for the dataset.
-
To map the data set columns to table columns, select for "DataSet", expand Return Parameter, enter a name for the dataset column (a dataset column name should be the same as the database column name), and then consume the table column in the dataset object value. Repeat the steps to add more columns to the dataset.
Dataset type for method input parameters is not supported. Only the return type of dataset can be mapped to a Table. At runtime, the table is populated with the data in the dataset.
-
- Select OK.
-
Select
Save.
The newly created action is added to the list.
-
Associate the action with the control to trigger this action. See
Configure actions for form control
events. Alternatively, to call this action for a form event, associate the action with the form. See
Associate an action with a form.
If you try to modify a .NET method action that is using an assembly created in .NET Core, and if .NET 8 or higher is not installed, an error message is displayed.