|
|||||||||
| 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.PIStateChangedMessage
public class PIStateChangedMessage
A PIStateChangedMessage is similar to NotifyMessage messages. It
informs a registered observer about a state change of an observed process instance.
The WfXML-layer automatically sends a PIStateChangedMessage to an
observer if a process instance (that has been created with WfXML and for which
an observer has been defined) is terminated or finishes.
You can send PIStateChangedMessage messages on any other state changes
manually. Important is, that you set the oid of the process instance that changes
its state with the setProcessInstanceKey(java.lang.String) method. Then you can send the
message with the sender's Sender.send(WfXMLMessage,Class,boolean) method.
The sender will search for the observer automatically and send the message to the
right observer on the right partner server.
| Field Summary | |
|---|---|
protected static java.lang.String |
MSG_BODY_REQ
|
protected static java.lang.String |
MSG_BODY_RESP
|
| Constructor Summary | |
|---|---|
protected |
PIStateChangedMessage(org.jdom.Document doc)
This method is used internally for creating a PIStateChangedMessage out of a xml document. |
|
PIStateChangedMessage(short messageType)
Use this method to create a new ChangePIStateMessage message. |
| Method Summary | |
|---|---|
void |
addNote(DMSNote note)
Use this method to add a note to this message. |
void |
addParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Use this method to add a parameter to the ResultData part of the request. |
void |
addProcessForm(java.lang.String formName,
DMSForm form)
Use this method to add a process form to this message. |
void |
addToDMSFolder(DMSObject obj)
This method adds a DMSObject to this
message. |
WfXMLFolder |
getDMSFolder()
This method returns a WfXMLFolder object containing
the content of the DMS folder part of this message. |
java.lang.String |
getKey()
This method returns the key of this message. |
java.util.Date |
getLastModified()
Returns the date at which the process instance has been last modified. |
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 |
getProcessForm(java.lang.String formName)
Use this method to get a specific process form out of this message. |
java.lang.String |
getProcessInstanceKey()
Use this method to get the process instance key of the process instance that changed its state. |
java.lang.String |
getProcessInstanceKeyOid()
Use this method to get the oid of the process instance which has changed its state. |
short |
getState()
Returns the new state of the process instance that changed its state. |
WfXMLObject[] |
listDMSFolderContent()
Use this method to get the content of this message's DMSFolder (that's the DMSFolder content of the process instance that changed its state). |
WfXMLNote[] |
listNotes()
Use this method to get all notes as WfXMLNote objects out of this
message. |
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. |
WfXMLForm[] |
listProcessForms()
Use this method to get an array of process forms included in this message. |
void |
prepare(Partner partner)
This method prepares the message to be sent to a specific partner. |
void |
setKey(java.lang.String procInstObserverID)
Sets the key for the ProcessInstanceStateChanged message. |
void |
setLastModified(java.util.Date lastModified)
This method sets the date at which the process instance has been modified the last time. |
void |
setMessageType(short type)
Set the message type of this WfXML message (in the message header). |
void |
setParameter(java.lang.String parameterName,
java.lang.String parameterValue)
Use this method for setting a parameter in the ResultData part of request messages. |
void |
setProcessInstanceKey(java.lang.String processInstanceOid)
This method sets the process instance key (oid) of the process instance that changed its state. |
void |
setState(short state)
This method sets the new state of the process instance that changed its state. |
| 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 PIStateChangedMessage(short messageType)
messageType - The type of new message you want to create: this can be
either WfXMLMessage.REQUEST or WfXMLMessage.RESPONSE.protected PIStateChangedMessage(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.
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 prepare(Partner partner)
Sender before the message is sent, so it should be
never necessary to call this method yourself.
prepare in class WfXMLMessagepartner - The partner to which the message will be sent.
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)
processInstanceOid - oid of the process instance that changed its
state.public java.lang.String getProcessInstanceKey()
String containing the process instance key.
public java.lang.String getProcessInstanceKeyOid()
throws WfXMLMessageException
getProcessInstanceKey()
method returns.
null if the message doesn't contain a
process instance key.
WfXMLMessageException - if the key doesn't contain readable data (maybe
not @enterprise format?).public void setState(short state)
state - The new state of the process instance. The value must be one
of the values defined in the WfXMLMessage class. If you set state
to WfXMLMessage.PI_STATE_NONE the state element will be removed
from the message.public short getState()
WfXMLMessage. If the
message doesn't contain a state element, the returned value will be
WfXMLMessage.PI_STATE_NONE.
public void setLastModified(java.util.Date lastModified)
GetPIDataMessage message. Thus, the date should be
the date at which the last task has been started (for running process instances),
or the date at which the process instance has been finished (for finished process
instances).
lastModified - A Date object representing the last
modified date.
public java.util.Date getLastModified()
throws WfXMLMessageException
null will be
returned.
Date object representing the last modified date.
WfXMLMessageException - if the message contains a last modified date
that doesn't meet the WfXML date requirements.
public void addNote(DMSNote note)
throws java.lang.Exception
note - The DMSNote object you want to
add.
java.lang.Exception - if any error occurs while the note is added.public WfXMLNote[] listNotes()
WfXMLNote objects out of this
message.
WfXMLNote objects, or an empty array if there
are no notes in the message.
public void addProcessForm(java.lang.String formName,
DMSForm form)
throws java.lang.Exception
formName - The form name of that process form as defined in the
process definition.form - The DMSForm that you want to add.
ApplicationException - if any other error occurs while the process form is
added (database problems, etc.).
java.lang.Exceptionpublic WfXMLForm[] listProcessForms()
public WfXMLForm getProcessForm(java.lang.String formName)
WfXMLForm, so you can access all of its
content easily.
formName - The form name of the process form that you want to get.
WfXMLForm with the content of the form, or
null if no process form with the given name exists.
public void addToDMSFolder(DMSObject obj)
throws java.lang.Exception
DMSObject to this
message.addProcessForm
method instead.obj may be one of the following:
DMSNote - the DMSNote is added (this is
a note in the document folder and not a note which is attached to
the process instance).DMSWebLink - the content of the
web link will be added.DMSDocForm - the document (base64 encoded)
and any notes that may be attached to the document are added.DMSFolder - a whole DMSFolder including all
content (also subfolders!) is added.DMSForm - the form plus any referenced forms
and subforms and attached notes are added.DMSLink - the linked object (=> one of the
4 types mentioned before) is added.
obj - The DMSObject that you want to
add to the message.
java.lang.Exception - if any error occurs while the object is added.public WfXMLObject[] listDMSFolderContent()
WfXMLObject objects. If you need
DMSObject objects, you can create
DMSObjects easily by calling the
WfXMLObjects' WfXMLObject.createDMSObject(com.groiss.org.User) method.
WfXMLObject objects. If the
folder is empty, the returned array will be empty, too.public WfXMLFolder getDMSFolder()
WfXMLFolder object containing
the content of the DMS folder part of this message. Warning: don't create a
DMSFolder out of this folder, because it is not supposed
to be created "in real". You can use this folder to update an existing folder
(especially the DMS folder of a process) by using the folder's
fill method.
DMSFolder holding the content of this message's
DMS folder.
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 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 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 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 | ||||||||