Salesforce

Building the Argument Attribute String (Magic xpi 4.13)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Building the Argument Attribute String (Magic xpi 4.13)

This topic explains how to configure an IBM i connector to call an IBM i program with the following two parameters:

  • UserID (Alpha 10)

  • MESSAGE (Alpha 100)

You should first build an attribute string of parameters, and then call the IBM i program as described below:

  1. From the Project menu, select Settings. The Settings dialog box opens.

  2. In the Settings dialog box, click Resources.

  3. Click Add. The New Resource dialog box opens.

  4. Select System i from the drop-down list, and give your new System i resource an appropriate name.

  5. Enter the following required information:

    • IP Address

    • User

    • Password

  1. Create a new flow.

  2. Place an IBM i connector in the flow area. The Properties pane opens. In the Interface parameter, select Method.

  3. Double-click or right-click on the connector and select Configuration from the context menu to open the Direct Access Method IBM i dialog box.

  4. In the Direct Access Method IBM i dialog box, click Add and select the Build Attribute String method.

  5. Set the first parameter, UserID, with the following attributes:

    • Argument Type = Alpha

    • Argument Length = 10

    • Argument Direction = Input

    • Argument Attribute String = C.UserString

When this method is executed, the C.UserString variable is modified according to the attributes of the UserID parameter.

  1. In the Direct Access Method IBM i dialog box, click Add to insert another Build Attribute String method.

  2. Set the second parameter, MESSAGE, with the following attributes:

    • Argument Type = Alpha

    • Argument Length = 100

    • Argument Direction = Output

    • Argument Attribute String = C.UserString

When this method is executed, the C.UserString variable is modified according to the attributes of the UserID and MESSAGE parameters.

After the execution of each Build Attribute String method, the C.UserString variable is appended with the information of the new parameter.

  1. In the Direct Access Method IBM i dialog box, click Add to add the Program Call method, and enter the following required information:

    • Program Library

    • Program Name

    • Number of Arguments = 2

    • Argument String = C.UserString (which is built using the Build Attribute String method described earlier)

  1. Specify the UserID and MESSAGE variables for the Arg1 and Arg2 parameter fields respectively.

  2. Click OK to close the Direct Access Method IBM i dialog box.

  3. Execute the flow with the Magic xpi Debugger. The following process is executed.

As the first two methods (the Build Attribute String methods for two arguments) are executed, the Argument Attribute String is built and stored in the C.UserString variable.

In the third method (Program Call), the C.UserString, which has the complete Argument Attribute String, is passed. In this example, its value would be: A10,O:A100

Where:

  • A10 means that the first parameter is of type Alpha, length 10, and its direction is IN.

  • O:A100 means that the second parameter is of type Alpha, length 100, and its direction is OUT.

The UserID and MESSAGE variables are supplied as an actual argument for the Program Call method.

  1. A message is sent to an IBM i user. On IBM i, use the DSPMSG <username> command to view the message.

Reference
Attachment 
Attachment