|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.wfxml.WfXMLMessage
com.groiss.wfxml.NotifyMessage
public class NotifyMessage
Notify messages are used to inform process instance observers about
arbitrary events or other things. Observers must implement the
ProcessInstanceObserver interface and be added to CreatePIMessage
messages when remote process instances are created.
When you create notify message, you must set the process instance oid of the process
instance from which you send the notify message with the setProcessInstanceKey(java.lang.String)
method. Then you send the message with the Sender's Sender.send(WfXMLMessage,Class,boolean)
method. This method searches for an observer and sends the message to the right
observer, so you don't need to care about finding observers at all.
This message type has various getParameter and setParameter
methods for using parameters. Parameters can be defined individually according to
your needs.
| Field Summary | |
|---|---|
protected static java.lang.String |
MSG_BODY_REQ
|
protected static java.lang.String |
MSG_BODY_RESP
|
| Constructor Summary | |
|---|---|
protected |
NotifyMessage(org.jdom.Document doc)
This method is used internally for creating a NotifyMessage out of a xml document. |
|
NotifyMessage(short messageType)
Creates a new and empty NotifyMessage object. |
| Method Summary | |
|---|---|
void |
addParameter(java.lang.String parameterName,
org.jdom.Element content)
Like addParameter(String, String) but you
can add whatever you want (complex structures...) with a JDOM
Element here. |
void |
addParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Use this method to add a parameter to the ContextData part of the request. |
void |
addParameter(java.lang.String parameterName,
WfXMLForm form)
Use this method to add a WfXMLForm as parameter to this
message. |
java.lang.String |
getKey()
This method returns the key of this notify message. |
java.lang.String |
getNotificationName()
Use this method for getting the notification name set in this notify request message. |
java.lang.String |
getParameter(java.lang.String parameterName)
Use this method to retrieve a simple text parameter, which has been set with setParameter(String, String) before. |
WfXMLForm |
getParameterForm(java.lang.String parameterName)
Use this method to retrieve a WfXMLForm object representing
a form that has been set for or added to the parameter parameterName. |
java.lang.String |
getProcessInstanceKey()
This method returns the process instance key that is defined in notify request messages. |
java.lang.String |
getProcessInstanceKeyOid()
Use this method to get the oid of the process instance which sent the notify request message. |
java.util.Collection |
listParameterForms(java.lang.String parameterName)
This method returns a Collection containing
WfXMLForm objects which were set for the given
parameter parameterName. |
java.util.Collection |
listParameterValueElements(java.lang.String parameterName)
This method returns a Collection with all
values (as JDOM Element objects) for the given parameter. |
java.util.Collection |
listParameterValueStrings(java.lang.String parameterName)
Use this method to get a Collection filled with
the strings of all values of a parameter. |
void |
prepare(Partner partner)
The prepare method prepares a message for being sent to the given partner. |
void |
setKey(java.lang.String procInstObserverID)
Sets the key for the Notify message. |
void |
setMessageType(short type)
Set the message type of this WfXML message (in the message header). |
void |
setNotificationName(java.lang.String name)
Set a notification name for a notify request message. |
void |
setParameter(java.lang.String parameterName,
org.jdom.Element content)
Similar to setParameter(String, String)
but you can set your own JDOM Element as content
here. |
void |
setParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Use this method for setting a parameter in the ContextData part of request messages. |
void |
setParameter(java.lang.String parameterName,
WfXMLForm form)
Use this method to set a WfXMLForm as a parameter for this
message. |
void |
setProcessInstanceKey(java.lang.String processInstanceOID)
Use this method to set the process instance key of the process instance, which sends the notify request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String MSG_BODY_REQ
protected static final java.lang.String MSG_BODY_RESP
| Constructor Detail |
|---|
public NotifyMessage(short messageType)
protected NotifyMessage(org.jdom.Document doc)
doc - JDOM Document containing the content for the message.| Method Detail |
|---|
public void setKey(java.lang.String procInstObserverID)
throws java.lang.IllegalArgumentException
setProcessInstanceKey(java.lang.String)
method). Then you can send the message with the sender's
Sender.send(WfXMLMessage,Class,boolean) method, which is especially designed
to send NotifyMessage and PIStateChangedMessage messages. It searches
for an observer of the local process instance and sends the message to the right
partner server and observer, so it is not necessary to search for observers or
remember observers manually.
procInstObserverID - The ID of the process instance observer on the remote
partner server (just the ID, not a complete WfXML key).
java.lang.IllegalArgumentException - if procInstObserverID == null.
public java.lang.String getKey()
throws WfXMLMessageException
WfXMLMessageException - if the key doesn't exist or if it is not
compatible to @enterprise requirements.
public void setMessageType(short type)
throws java.lang.IllegalArgumentException
WfXMLMessage
setMessageType in class WfXMLMessagetype - Use the constants WfXMLMessage.REQUEST or WfXMLMessage.RESPONSE
as value for this parameter, depending on if you want to create
a request or a response message.
java.lang.IllegalArgumentException - If type is illegal.public void setProcessInstanceKey(java.lang.String processInstanceOID)
getProcessInstanceKey() method
to get the key out of this notify message in order to find out from which
process instance the message has been sent.
processInstanceOID - The oid of the process instance that sends the notify
request.public java.lang.String getProcessInstanceKey()
null
if the message doesn't contain a process instance key.
public java.lang.String getProcessInstanceKeyOid()
throws WfXMLMessageException
getProcessInstanceKey() method returns.
null if the message doesn't contain a key.
WfXMLMessageException - if the key doesn't contain readable data (maybe
not @enterprise format?).public void setNotificationName(java.lang.String name)
name - A name for this notification.public java.lang.String getNotificationName()
null if no notification name
is defined in the message.public void prepare(Partner partner)
Sender.send(WfXMLMessage,Class,boolean) method
of the Sender.
prepare in class WfXMLMessagepartner - The partner to which the message will be sent.
public void setParameter(java.lang.String parameterName,
java.lang.String parameterValue)
addParameter method instead.
parameterName - Name of the parameter that you want to set.parameterValue - The value for the parameter.
public void setParameter(java.lang.String parameterName,
org.jdom.Element content)
setParameter(String, String)
but you can set your own JDOM Element as content
here. Use this method to add complex, self-defined data...
parameterName - Name of the parameter that you want to set.content - A JDOM Element object containing
everything you want to set as parameter.
public void setParameter(java.lang.String parameterName,
WfXMLForm form)
WfXMLForm as a parameter for this
message. If the parameter already existed before, the old value(s) will be
lost.
parameterName - The name of the parameter you want to set.form - The WfXMLForm you want to add.
public void addParameter(java.lang.String parameterName,
java.lang.String parameterValue)
parameterName - Name of the parameter for which you want to add a value.parameterValue - The value for the parameter.
public void addParameter(java.lang.String parameterName,
org.jdom.Element content)
addParameter(String, String) but you
can add whatever you want (complex structures...) with a JDOM
Element here.
parameterName - Name of the parameter for which you want to add a value.content - A JDOM Element object containing
content (attributes, subelements, etc.). All this content will be added as
a value to the parameter.
public void addParameter(java.lang.String parameterName,
WfXMLForm form)
WfXMLForm as parameter to this
message. Using a WfXMLForm is an easy way to create forms
when you don't have an existing DMSObject
available.listParameterForms
method.
parameterName - The name of the parameter under which you want to add
this form.form - A reference to the WfXMLForm object you want
to add to this parameter.public java.lang.String getParameter(java.lang.String parameterName)
setParameter(String, String) before. Take
care: if you use this method to access a parameter which contains multiple
values, you will only retrieve one of these values with this method! If you
want to get all the values of such a multiple-value parameter, use the
listParameterValueStrings method instead.
parameterName - The name of the parameter you are searching for.
String containing the value of the
parameter, or null if the parameter was not found in the
message.public WfXMLForm getParameterForm(java.lang.String parameterName)
WfXMLForm object representing
a form that has been set for or added to the parameter parameterName.
If the parameter contains more than one form, you will retrieve one of these
forms (it cannot be guaranteed which one!). So if you know that there is
maybe more than one form for this parameter, use the method
listParameterForms, which returns a collection
of all forms, instead.
parameterName - The name of the parameter you want to get a form of.
WfXMLForm object containing the data of the
form, or null if the parameter doesn't exist or if it doesn't
contain a form.public java.util.Collection listParameterForms(java.lang.String parameterName)
Collection containing
WfXMLForm objects which were set for the given
parameter parameterName. If you are sure that there is only
one WfXMLForm set for this parameter, you could also use
the getParameterForm method, which doesn't return
a collection, but only one single WfXMLForm.
parameterName - The name of the parameter for which you want to retrieve
values.
Collection containing
WfXMLForm objects. If the parameter was not found or if
the parameter didn't contain any forms, the returned collection will be
empty.public java.util.Collection listParameterValueElements(java.lang.String parameterName)
Collection with all
values (as JDOM Element objects) for the given parameter.
So this method is good for retrieving values which have been set with the
addParameter(String, Element) or
setParameter(String, Element) methods.
parameterName - The name of the parameter for which you want to retrieve
the value elements.
Collection containing
Element objects representing the values of
the parameter. If the paramter is not found, the collection is empty.public java.util.Collection listParameterValueStrings(java.lang.String parameterName)
Collection filled with
the strings of all values of a parameter. You only retrieve the texts of the
parameter's values, so this method makes most sence for "simple" parameters
that have been set with the setParameter(String, String)
or addParameter(String, String) methods.
parameterName - The name of the parameter for which you want to retrieve
the value strings.
Collection containing
String objects representing the texts of all
values of the parameter. The Collection is
empty if the parameter does not contain values or if the parameter was not
found in the message.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||