This topic applies only to the IBM Business Process Manager Advanced configuration.

Creating Custom parameter mappings

This type of parameter mapping is employed so that arbitrary Java code can be introduced (or called out) when an interface map is invoked. Custom parameter mappings can take any parameter and change it as needed. For example, you can use the Custom parameter mapping to reconcile a simple type parameter with a business object parameter where the Java code will create an instance of business object and populate it according to the value of the simple type. A Custom parameter mapping can have only one input, but can feed multiple outputs.

About this task

To create a Custom parameter mapping, follow these steps:

Procedure

  1. In the Parameter mappings section of the editor, right-click the source parameter and select Create Parameter Mapping or click and drag the connection (the yellow "grabby" Yellow grabby in editor) to the chosen target parameter. A Move parameter mapping is created.
  2. Select the Move parameter mapping and, in the Properties view, change the parameter mapping type to Custom by selecting Custom from the drop-down list. The parameter mapping type is now set to Custom.
  3. In the Details tab of the Properties view, you will need to provide the fully qualified name of the class, which extends the Java mediation class com.ibm.wbiserverspi.mediation.JavaMediation or com.ibm.wbiserverspi.mediation.JavaMediationDataObject and provides implementation for this parameter mapping. You can select a class from the workspace by clicking Browse or create a new Java class by clicking New.
  4. Click Finish.
  5. Now you need to create a Java code which will implement a body of the following method:public java.lang.Object mediate(java.lang.Object arg0) throws com.ibm.wbiserverspi.mediation.MediateException. The attribute arg0 is the input parameter and in this particular case it is the 'customer_data' of type String. The method should return an object corresponding to the other parameter of this mapping which is of type NewCustomer and is a business object. You may create the code either by using the graphical capabilities of the Visual Snippet editor or by switching to the Java mode and typing standard Java code.
  6. Or, to select an existing Java class, click Browse and select the appropriate Java class.
  7. Click OK.