Starting an interruptible process using the JMS interface

Steps for this task

  1. Create a message, for example, an ObjectMessage message.
    ObjectMessage message= queueSession.createObjectMessage();
  2. (Optional)   Set the JMSReplyToQueue.
    If you do not want to receive a reply, this step is optional. You cannot specify a temporary queue as a reply-to queue.
    // Specify the destination object replies are to be sent to
    message.SetJMSReplyTo(replyToQueue);
  3. Set the Java Message Service (JMS) properties.
    If you do not specify any properties, the process-template name, Dispatch is assumed. If JMSReplyToQueue is set, call is issued. If JMSReplyToQueue is not set, initiate is issued. If the process-instance name is set, it must not start with an underscore. If the process-instance name is not set, the process instance ID (PIID) in String format is used as the name.
    message.SetStringProperty("wf$verb", "initiate");
    message.SetStringProperty("wf$processTemplateName",  "CustomerTemplate");
    message.SetStringProperty("wf$processInstanceName", "CustomerOrder");
  4. Start the process with an input message.
    Specify the input message as the body, the payload, of the message. In the following, Customer is a message type known to the system.
    // Create Customer input message
    Customer input= new Customer();
    input.setLastName("Smith");
    
    message.setObject(new ClientObjectWrapper(input));
    
    // Send message
    queueSender.send(message);
    This action creates an instance, CustomerOrder, of the process template, CustomerTemplate, and passes some customer data. The operation returns the object ID of the newly created instance as the value of the JMS property, wf$piid, if a JMSReplyToQueue is specified. The reply message does not contain a payload.
  5. Get the result of the process initiation.
    Message m = queueReceiver.receive();
    String fiid = m.getStringProperty("wf$piid");



Searchable topic ID:   t6macstj
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/wfapi/tasks/t6macstj.html

Library | Support | Terms of Use | Feedback