Start the process with an input message of the appropriate type. When you create the message, you must specify its message type name
so that the message definition is contained.
ActivityServiceTemplateData activity = startActivities[0];
//create a message for the service to be called
ClientObjectWrapper input =
process.createMessage(activity.getServiceTemplateID(),
activity.getActivityTemplateID(),
activity.getInputMessageTypeName());
DataObject myMessage = null;
if ( input.getObject()!= null && input.getObject() instanceof DataObject )
{
myMessage = (DataObject)input.getObject();
//set the strings in the message, for example, a customer name
myMessage.setString("CustomerName", "Smith");
}
//run the process
ClientObjectWrapper output = process.call(activity.getServiceTemplateID(),
activity.getActivityTemplateID(),
input);
//check the output of the process, for example, an order number
DataObject myOutput = null;
if ( output.getObject() != null && output.getObject() instanceof DataObject )
{
myOutput = (DataObject)output.getObject();
int order = myOutput.getInt("OrderNo");
}
This action creates an instance of the process
template, CustomerTemplate, and passes some customer data. The operation returns
only when the process is complete. The result of the process, OrderNo, is
returned to the caller.