"InvokeMethod" activity

Created by akaBot Support, Modified on Tue, 19 Nov, 2024 at 1:33 PM by akaBot Support

Introduction to the "Invoke Method" activity


TABLE OF CONTENTS


1. Activity program name

System.Activities.Statements.InvokeMethod


2. Description

Up to Studio Version 2.0.2.0

Quick Access: "Toolbox" > "Original" > "Invoke Method"


From Studio Version 2.0.3.0

Quick Access: "Toolbox" > "System" > "Original" > "Invoke Method"


This activity allows you to invoke and execute a method.

Note: Operation confirmed with Studio version 2.1.1.2. Some wording may vary depending on the version.


3. Properties


Property item
Property name
Input fieldDescription
OtherPublicCheckbox

Variables and arguments in the activity are logged in the log file and pushed to Center. (Refer to "About the 'Public' Property Item" for details)

Parameters

Enter Value

Set parameters for the method to be called.

Method Name

Enter Value

Set the method name

Result

Enter Value (OutArgument Type)

Set the return value of the executed method.

Target object

Enter Value (InArgument Type)

Create the object containing the method if executing asynchronously.

Target Type

Dropdown

Set the type containing the static method if calling a static method.

Generic Type Arguments

Dropdown

Set generic types in this collection when calling a generic method.

Run Asynchronously

Checkbox

Executes the method that returns a value.

Display Name

Enter Value (String Type)

Reflected in the activity name in the designer panel


4. How to use

Here’s an example of how to use "Invoke Method" to merge the values of two data tables.

*In this example, we will merge data from one data table ("addRateData") into another data table ("rateTable") created with "Build Data Table" .Please also refer to the "Merge Data Table" knowledge base.

Data Table "dt1"
Created as "rateTable," but referred to as "dt1" in this example.


Data Table to Merge "dt2"
Created as "addRateData," but referred to as "dt2" in this example.


First, drag and drop "Core" > "Data Table" > "Build Data Table" onto the designer panel, and set the data table (contents of "dt1").

In the Properties, under "Output" > "Data Table," enter a variable of DataTable type (in this example, "dt1").
Refer to "Creating Variables" for more information.

Drag and drop "Core" > "Data Table" > "Build Data Table" again to set up the data table (contents of "dt2") and enter a DataTable variable (in this example, "dt2") under "Output" > "Data Table."

Next, drag and drop "System" > "Primitives" > "Invoke Method" onto the designer panel.

In Properties, under "Other" > "Parameters," click the "..." button.

In the pop-up window, enter the parameters and click "OK."
In this example, set "Direction: Input," "Type: DataTable," and "Value: dt2."

Enter the values in "Other" > "Method Name" and "Target Object" properties (in this example, "Merge" and "dt1," respectively).

Drag and drop "Core" > "Data Table" > "Output Data Table" onto the designer panel.

In Properties, under "Output" > "Text," enter a variable of String type (in this example, "result"), and in "Input" > "Data Table," enter a DataTable variable (in this example, "dt1").

To confirm the execution result, place a "Write Line" activity and set the necessary variables, such as "result" in this example.

Click "Home > Start" or press "F5" to run the workflow, then open the output panel to verify that the data from "dt1" and "dt2" has been merged and displayed.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article