ObjectMessage message = queueSession.createObjectMessage();
//Specify the destination object replies are to be sent to message.SetJMSReplyTo(replyToQueue);
message.SetStringProperty("wf$verb", "call"); message.SetStringProperty("wf$processTemplateName", "CustomerTemplate");
//Create Customer input message WSIFDefaultMessage input = new WSIFDefaultMessage(); input.setObjecPart("CustomerName", "Smith"); message.setObject(new ClientObjectWrapper(input)); //Send message queueSender.send(message);This action creates an instance of the process template, CustomerTemplate, and passes some customer data. The operation returns only when the flow is complete and when a JMSReplyToQueue is specified. The result of the process, OrderNo, is returned as the payload of the reply message. Because an ObjectMessage message was passed, an object message is returned.
Message m = queueReceiver.receive(); if (m instanceof ObjectMessage) { ClientObjectWrapper wrapper = (ClientObjectWrapper)m.getObject(); DataObject output = (DataObject)wrapper.getObject(); int order = output.getInt("OrderNo"); }
Related concepts
Structure of a Business Process Choreographer JMS message
Authorization for JMS renderings