Salesforce

Java Class Connector (Magic xpi 4.5)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Java Class Connector (Magic xpi 4.5)

Objective

This technical note demonstrates how to use the Java Class Connector utility.

Description

The Java Class Connector utility lets you access and manipulate Java classes and objects. Accessing Java Class objects is achieved by selecting the required objects, such as Instance Methods, Instance Variables, Static Methods, or Static Variables, and receiving the returns from each. This allows components in your flow to access the Java class.

Example

This example describes how to create dynamic arrays using the java.util.Vector class.

  1. Drag a Java Class Connector utility to your flow.

  2. Click Configuration to open the Configuration dialog box.

  3. In the Class name enter java.util.Vector.

  4. In the Constructor drop-down list select ()V, and then click Select.

Note:

You do not need to define the constructor’s parameters to create the new object.

  1. Next to Object reference, click to open the Variables List. Select a variable to hold the object, and then click Select.

  2. Click Method to open the Select Method screen.

  3. Click New and from the drop-down list, select IM_setSize(I)V as your method. This method sets the vector size.

  4. In the Method parameters section, enter a numeric value to set the size of the vector.

  5. Click New again to add another method.

  6. From the drop-down list, select IM_size()I as your method. This method returns the vector size.

  7. Next to Return value, click to select the variable that will hold the method’s answer.

  8. Click OK three times to complete the configuration.

  9. Drag a Save Message utility to your flow.

  10. To the right of the Messages field, click to open the Expression Editor.

  11. Enter your second method’s Return value and then use the Str function to convert it to an Alpha string.

  12. Run the project.

Reference
Attachment 
Attachment