iRobo.Activity.InvokeMethod

Invoke Method activity is used to call a public method of a specified object or type.

                                                                                                               

Properties

Misc

  • DisplayName -  Activity header name.
  • GenericTypeArguments -  Specify generic types in collection to invoke generic methods.
  • MethodName - Enter Method name. (Mandatory)
  • Parameters - Method collection parameter.
  • Result -  Return value.
  • RunAshynchoronasly -  Run Method synchronously or not. Its input is True/False arguments. 
  • TargetObject - Object that contains non-static methods.
  • TargetType - Specify method type.

     Note: 

            Either TargetObject or TargetType property is required for Invoke Method Activity.

                                                                                                       


Example on Using InvokeMethod Activity

To better understand Invoke Method Activity, let's build an automated process that trigger a method to add  Table to Data Set.


  1. Open iRobo Studio, and then open a new Workflow.
  2. Create  DataSet,  DataTable Variables into Variable Table as shown in the image below.
  3. Drag two Assign Activity to the Sequence.
  4. Assign DataSet Variable to the first Assign Activity as: ds = new DataSet(), as shown in the image below.

  1. Assign DataTable Variable to the second Assign Activity as: dt = new System.Data.DataTable("New Table"), as shown in the image below.

  1. Drag Invoke Method Activity to the Sequence.
    • Set TargetType as: (null).
    • Add ds.Tables as: TargetObject.
    • Type MethodName.

  1. Drag MessageBox Activity to the Sequence, as shown in the image below.

  1. Type into Message Property ds.Tables(0).TableName.ToString().
  2. Click Save button from iRobo Studio Menu to save Workflow.
  3. Click Play button to start the automated process.



Created with the Personal Edition of HelpNDoc: Free Web Help generator