How to Customize Input Mappings for the Java Integration Component in IBM BPM

BPM 7.5.1 introspects class files to learn about the input mappings that need to be configured, and displays parameter names as Parameter 1, for example, unless you provide bean-info classes.

Sample

public final class Sample {

  public static int sum(final int a, final int b) {
    return a + b;
  }

}

SampleBeanInfo

import java.beans.MethodDescriptor;
import java.beans.ParameterDescriptor;
import java.beans.SimpleBeanInfo;

public final class SampleBeanInfo extends SimpleBeanInfo {

  public MethodDescriptor[] getMethodDescriptors() {
    MethodDescriptor[] methods = null;

    try {
      methods = new MethodDescriptor[1];

      final ParameterDescriptor[] params = new ParameterDescriptor[2];

      params[0] = new ParameterDescriptor();

      params[0].setDisplayName("a");

      params[1] = new ParameterDescriptor();

      params[1].setDisplayName("b");

      methods[0] = new MethodDescriptor(Sample.class.getMethod("sum", new Class[] { int.class, int.class }), params);
    } catch (final Exception e) {
      e.printStackTrace();
    }

    return methods;
  }

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s