Service EJB form - Completing the Parameters tab

Configure the data mapping for the incoming and outgoing data for an EJB service rule on the Parameters tab.

Note: Service EJB rules are no longer being actively developed, and are being considered for deprecation in upcoming releases. Using Service EJB rules does not follow Pega development best practices. Consider other implementation options instead.

Use the top section of the tab to specify how to map the arguments from the incoming requests to the Pega Platform properties. Use the Return Value section of the tab to specify how the service rule constructs the response.

The data types of the incoming and outgoing values can be simple scalars (Java primitive data types), arrays of scalars, Java objects (instances of Java classes), or arrays of Java objects.

Parameters List

Field Description
Data Type Select the data type of the incoming variable. The data types available in the selection list are the Java primitive data types ( Boolean, byte, int, short, long, float, double ), their array counterparts, and Java String.

To specify that the data type is a Java object or Java object array, click in the field and enter the name of the appropriate Java class. For example, java.util.List or com.mycompany.big.blue.Sky.

Name Enter the name of the external parameter.
Map To Specify the destination or the type of destination for the value in the Pega Platform. This field presents a subset of the following options, as appropriate for the data type you specified:
  • Clipboard — Use this option when the data in the external variable can be mapped data directly to the clipboard property or activity parameter specified in the Map To Key field.
  • XML ParseRule — Use this option when the data in an incoming string argument contains XML data and you want a Parse XML rule ( Rule-Parse-XML rule type) to process the data.
  • HTML PostData — Indicates that the incoming data value is a stream of data posted from an HTML form that contains property key/value pairs.
  • Custom function rule from a MapTo library, if any exist in your system. Review the function rule to determine what it does.
Map To Key The value that you specify in this field depends on the option you selected in the Map To field:
  • If the Map To value is Clipboard, enter the property name to which the data is to be mapped. Use curly brace characters to make an indirect reference, if the ultimate name of the destination property is the text value of another property. Choose a property of the appropriate mode (for example Single Value, Value List, or Object ) to receive the data. Use the form Param.name parameter name to set a parameter value on the parameter page of the service activity.
  • If the Map To value is XML Parse Rule, enter the Namespace name (second key part) and the Element Name name — third key part — of the appropriate XML parse rule. Separate the Namespace from the Element Name with a space. That is, use the syntax "NamespaceName ElementName" and not "NamespaceName.ElementName." The system uses the page class of this service rule as the first key part of the parse rule.
  • To maintain backward compatibility for service rules created in releases before PRPC Version 5.2, you can specify a data mapping with only a Namespace value. In that case, the system determines the Element Name key at runtime from the root element of the incoming XML document. However, this mapping works only if the Parser Type of the Parse XML rule is set to DOM and validation is not enabled. As a best practice, specify both the Namespace Name and the Element Name of the rule.

  • If the Map To value is HTML PostData, leave this field blank. The name/value pairs in the string will be mapped to the parameter page of the service activity rather than the primary page.
  • If the Map To value is a Rule-Utility-Function from a MapTo library, either select a property to hold the results of the function or leave this field blank, as appropriate for the function.

Return Value

Field Description
Return Value  
Data Type Select the data type of the return value. The data types available in the selection list are the Java primitive data types (Boolean, byte, int, short, long, float, double), their array counterparts, and Java String.
Map From Select the source or the type of source for the return value. This field presents a subset of the following options, as appropriate for the data type you specified:
  • Clipboard — Use when the data for the return value can be mapped directly from the clipboard property or activity parameter specified in the Map From Key field.
  • Constant — Use to specify a fixed value for the response.
  • XML Stream — Use when the data for the return value is an assembled XML document produced by an XML Stream rule.
  • HTML Stream — Use when the data for the return value is a stream of HTML produced by an HTML rule.
  • HTML Frame — Use when the data for the return value is a stream of HTML data generated by the service activity.
  • Custom function rule from a MapTo library, if any are present in your system. Review the function rule to determine what it does.
Map From Key The value that you specify in this field depends on the option you selected in the Map From field:
  • If the Map From value is Clipboard, enter the reference to the property or parameter.
  • For a Constant, enter a literal string. To include blank spaces in your text string, surround the string with double quotes.
  • For XML Stream, enter a Stream Name of the XML Stream rule that is generate the data. The system uses the Primary Page Class of the service as the Applies To key part.
  • For HTML Stream, enter the Stream Name key part of the HTML rule that is to generate the data stream. The system uses the Primary Page Class of the service as the Applies To key part.
  • For HTML Frame, enter the name of the frame specified as a parameter the Show-HTML step of the service activity. Use to return data from activities that were originally written for interactive browser clients and use the Show-HTML method.
  • If the Map From value is a Rule-Utility-Function from a MapFrom library, either select the property that holds the value to be processed by the function or leave this field blank, as appropriate for the function.