IMethodExecuter Method

The IMethodExecuter interface exposes the method listed in the following table:

Method

Description

IMethodExecuter.Call Method

Executes a specified public method defined in the AB Suite system.

IMethodExecuter.CallAsync Method

Executes a specified public method defined in the AB Suite system.

IMethodExecuter.Call Method

The Call method executes a specified public method defined in the AB Suite system.

Namespace – ABSuite.AccessLayer.Connector.Core

Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)

Syntax

Object Call(
   string method,
   Object[] args,
   bool[] modifiers
)

Arguments

  • method – System.String

    This argument provides the name of the public method.

  • args – System.Object[]

    This argument provides parameters that are required by the public method.

  • modifier – bool[]

    This argument provides an array of Boolean values that match the args[] array and specifies whether a parameter is passed by reference or not. If the Boolean value in the array is set to true, then the corresponding parameter in the args[] array is passed by reference. The modifier argument can be set to null, which means all parameters are passed by value.

Return Value

If this method succeeds, it returns an object containing the result of the public method call; otherwise, it returns an error message.

Using the IMethodExecuter Interface for the Call Method

The following code is an example of calling a public method named “Method1”, with a single string that is passed by reference (InOut):

object resultObj = ABSConnection.Call("Method1",  // Name of public method
   new object [] { "Hello" },   // Array of objects specifying parameters
   new bool[] { true }); // Parameter modifiers determine pass by reference or value

IMethodExecuter.CallAsync Method

The CallAsync method executes a specified public method defined in the AB Suite system.

Namespace – ABSuite.AccessLayer.Connector.Core

Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)

Syntax

Task<Object> CallAsync(
   string method,
   Object[] args,
   bool[] modifiers
)

Arguments

  • method – System.String

    This argument provides the name of the public method.

  • args – System.Object[]

    This argument provides parameters that are required by the public method.

  • modifier – bool[]

    This argument provides an array of Boolean values that match the args[] array and specifies whether a parameter is passed by reference or not. If the Boolean value in the array is set to true, then the corresponding parameter in the args[] array is passed by reference. The modifier argument can be set to null, which means all parameters are passed by value.

Return Value

If this method succeeds, it returns an object containing the result of the public method call; otherwise, it returns an error message.

Using the IMethodExecuter Interface for the CallAsync Method

The following code is an example of using the CallAsync method:

object resultObj = ABSConnection.CallAsync("Method1",  // Name of public method
   new object [] { "Hello" },   // Array of objects specifying parameters
   new bool[] { true }); // Parameter modifiers determine pass by reference or value