Salesforce

JavaCast (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

JavaCast

Casts data from Magic xpa to Java. Use this function whenever you need to implicitly cast a value to a Java type.

A possible use for this function is to select an overloaded method.

Another use for the JavaCast() function is to cast a Java variable of type Object to a specific object type, so you will be able to access its methods.

Syntax:

JavaCast (value, type)

Parameters:

value: a value of any type to cast the data from

type: the Java type to cast the data to

Returns:

A value according to a Java type.

Example:

Assume the following scenario: you have two Java methods with the same name, one receives a parameter of type Integer and the other of type Double. In this case, it is not legal to send a Magic xpa numeric value to this method, since Magic xpa cannot know which method to use.

So the proper way is to implicitly specify the Java type to use.

For example: JavaCast(5, Java.java.lang.Integer)

Note:

  • Only parkable controls set the values for the function. A parkable control is a control with data or a control that may return an action.

  • This function is not available in Web Client tasks.

Reference
Attachment 
Attachment