Salesforce

Building the Argument Attribute String (Magic xpi 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Building the Argument Attribute String (Magic xpi 3.x)

This topic explains how to configure a System 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 Resources. The Resource Repository dialog box opens.

  2. In the Resource Repository dialog box, click New. The New Resource dialog box opens.

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

  4. Enter the following required information:

  • IP Address

  • User

  • Password

  1. Create a new flow.

  2. Place a System i connector in the flow area. The Component Properties dialog box opens.

  3. In the Component Properties dialog box, click Configure. The Direct Access Method System i dialog box opens.

  4. In the Direct Access Method System i dialog box, click New 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 System i dialog box, click New 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.

Note:

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 System i dialog box, click New 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 all of the opened windows until you are back in the Flow Editor.

  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.

Note:

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