SMILA (incubation) API documentation

org.eclipse.smila.processing.bpel
Class MessageHelper

java.lang.Object
  extended by org.eclipse.smila.processing.bpel.MessageHelper

public final class MessageHelper
extends java.lang.Object

Utility class to create and parse the DOM XML messages which we use to talk to the ODE engine, and sync workflow objects to the blackboard.

Author:
jschumacher

Field Summary
static javax.xml.namespace.QName TYPE_PROCESSORMESSAGE
          WSDL type of standard processor messages.
static javax.xml.namespace.QName TYPE_SEARCHMESSAGE
          WSDL type of search processing messages.
 
Constructor Summary
MessageHelper(java.util.Properties properties)
          create instance.
 
Method Summary
 void addRequestId(org.w3c.dom.Element message, java.lang.String requestId, javax.xml.namespace.QName varType)
          add request id part as first child element of message.
 org.w3c.dom.Element createMessage(Blackboard blackboard, ProcessorMessage procMessage)
          create workflow objects for specified IDs, create DOM representations of this record list and embed it as BPEL message.
 org.w3c.dom.Element createSearchMessage(Blackboard blackboard, SearchMessage searchMessage)
          create workflow objects for query and record IDs in search message, create DOM representations of these records * and embed it as BPEL message.
 boolean hasRecordFilter()
           
 ProcessorMessage parseMessage(Blackboard blackboard, org.w3c.dom.Element message)
          sync workflow objects from DOM message to blackboard and return IDs of workflow objects.
 java.lang.String parseRequestId(org.w3c.dom.Element message)
          read request Id from message variable.
 SearchMessage parseSearchMessage(Blackboard blackboard, org.w3c.dom.Element message)
          sync workflow objects of a search message from DOM message to blackboard and return IDs of query and result objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_SEARCHMESSAGE

public static final javax.xml.namespace.QName TYPE_SEARCHMESSAGE
WSDL type of search processing messages.


TYPE_PROCESSORMESSAGE

public static final javax.xml.namespace.QName TYPE_PROCESSORMESSAGE
WSDL type of standard processor messages.

Constructor Detail

MessageHelper

public MessageHelper(java.util.Properties properties)
create instance.

Parameters:
properties - configuration properties
Method Detail

parseRequestId

public java.lang.String parseRequestId(org.w3c.dom.Element message)
read request Id from message variable.

Parameters:
message - variable value
Returns:
request Id

parseMessage

public ProcessorMessage parseMessage(Blackboard blackboard,
                                     org.w3c.dom.Element message)
sync workflow objects from DOM message to blackboard and return IDs of workflow objects.

Parameters:
blackboard - to sync workflow objects to.
message - DOM message from BPEL engine containing workflow objects.
Returns:
IDs of workflow objects in message

parseSearchMessage

public SearchMessage parseSearchMessage(Blackboard blackboard,
                                        org.w3c.dom.Element message)
sync workflow objects of a search message from DOM message to blackboard and return IDs of query and result objects.

Parameters:
blackboard - to sync workflow objects to.
message - DOM message from BPEL engine containing workflow objects.
Returns:
search message containing IDs of query and result records (if present in message).

createMessage

public org.w3c.dom.Element createMessage(Blackboard blackboard,
                                         ProcessorMessage procMessage)
                                  throws ProcessingException
create workflow objects for specified IDs, create DOM representations of this record list and embed it as BPEL message. This is done by appending them to <message><records> elements.

Parameters:
blackboard - blackboard to read records from.
procMessage - IDs of workflow objects in message
Returns:
DOM representation of workflow objects
Throws:
ProcessingException - error creating workflow record.

createSearchMessage

public org.w3c.dom.Element createSearchMessage(Blackboard blackboard,
                                               SearchMessage searchMessage)
                                        throws ProcessingException
create workflow objects for query and record IDs in search message, create DOM representations of these records * and embed it as BPEL message.

Parameters:
blackboard - blackboard to read records from.
searchMessage - IDs of query and workflow objects in message
Returns:
DOM representation of workflow objects
Throws:
ProcessingException - error creating workflow record.

addRequestId

public void addRequestId(org.w3c.dom.Element message,
                         java.lang.String requestId,
                         javax.xml.namespace.QName varType)
add request id part as first child element of message.

Parameters:
message - a message variable
requestId - request id.
varType - type of variable. currently necessary to decide where to put the Id.

hasRecordFilter

public boolean hasRecordFilter()
Returns:
true if a global record filter is configured.

SMILA (incubation) API documentation