public class PIStateChangedMessage extends WfXMLDocFormMessage
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.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.Modifier and Type | Field and Description |
---|---|
protected static String |
MSG_BODY_REQ |
protected static String |
MSG_BODY_RESP |
body, CONTEXTDATA_DOCUMENTCREATOR, documentCreator, documentCreatorId, header, message, MSG_BODY, MSG_BODY_CTXDATA, MSG_BODY_CTXDATA_DMSFOLDER, MSG_BODY_CTXDATA_NOTES, MSG_BODY_CTXDATA_PROCESSFORMS, MSG_BODY_CTXDATA_PROCESSFORMS_NAME, MSG_BODY_EXC, MSG_BODY_EXC_DESC, MSG_BODY_EXC_MAINCODE, MSG_BODY_EXC_SUBCODE, MSG_BODY_EXC_SUBJECT, MSG_BODY_EXC_TYPE, MSG_BODY_RSLTDATA, MSG_BODY_RSLTDATASET, MSG_BODY_SET_NAME, MSG_BODY_SET_PARAM, MSG_BODY_SET_VALUE, MSG_HEAD, MSG_HEAD_KEY, MSG_HEAD_REQ, MSG_HEAD_RESP, MSG_HEAD_RESPREQUIRED, MSG_HEAD_RESPREQUIRED_NO, MSG_HEAD_RESPREQUIRED_ONERROR, MSG_HEAD_RESPREQUIRED_YES, MSG_ROOT, MSG_TRANSPORT, MSG_TRANSPORT_CORDATA, MSG_TRANSPORT_CORDATA_OID, MSG_TRANSPORT_CORDATA_ORIGIN, MSG_TRANSPORT_CORDATA_TIMESTAMP, MSG_VERSION, namespace, PI_STATE_CLOSED_ABNORMAL_COMPLETED, PI_STATE_CLOSED_ABNORMAL_COMPLETED_STR, PI_STATE_CLOSED_COMPLETED, PI_STATE_CLOSED_COMPLETED_STR, PI_STATE_NONE, PI_STATE_OPEN_NOTRUNNING, PI_STATE_OPEN_NOTRUNNING_STR, PI_STATE_OPEN_RUNNING, PI_STATE_OPEN_RUNNING_STR, REQUEST, RESPONSE, RESPONSE_NOT_REQUIRED, RESPONSE_REQUIRED, RESPONSE_REQUIRED_ONERROR, root, transport, usingPlainKey
Modifier | Constructor and Description |
---|---|
protected |
PIStateChangedMessage(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.
|
Modifier and Type | Method and Description |
---|---|
void |
addParameter(String parameterName,
String parameterValue)
Use this method to add a parameter to the ResultData part of the request.
|
protected Element |
getDMSParentElem()
Get the correct element of the message that wiil contain DMS artefacts;
|
String |
getKey()
This method returns the key of this message.
|
Date |
getLastModified()
Returns the date at which the process instance has been last modified.
|
String |
getParameter(String parameterName)
Use this method to retrieve a simple text parameter, which has been set with
setParameter(String, String) before. |
String |
getProcessInstanceKey()
Use this method to get the process instance key of the process instance
that changed its state.
|
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.
|
Collection<String> |
listParameterValueStrings(String parameterName)
Use this method to get a
Collection filled with
the strings of all values of a parameter. |
void |
prepare(Partner partner)
This method prepares the message to be sent to a specific partner.
|
void |
setKey(String procInstObserverID)
Sets the key for the ProcessInstanceStateChanged message.
|
void |
setLastModified(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(String parameterName,
String parameterValue)
Use this method for setting a parameter in the ResultData part of request
messages.
|
void |
setProcessInstanceKey(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.
|
addProcessForm, addProcessForm, addToDMSFolder, addToDMSFolder, addToDMSFolder, attachNote, attachNote, attachNote, createAttachedNotes, getAttachedNotes, getDMSFolder, getProcessForm, listDMSFolderContent, listProcessForms
addParameterValueElem, assureBodyExists, assureHeaderExists, assureTransportExists, createMessage, createMessage, getDocumentCreator, getException, getMessageIdentifier, getMessageOrigin, getMessageType, getParameterValueElem, getParameterValueElems, getPlainKey, getResponseRequired, getStateString, getTimestamp, getTransportElementValue, setDocumentCreator, setException, setMessageIdentifier, setMessageOrigin, setPlainKey, setResponseRequired, setTimestamp, setTransportElement, toPrettyString, toString, write
protected static final String MSG_BODY_REQ
protected static final String MSG_BODY_RESP
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(Document doc)
doc
- JDOM Document containing the content for the message.public void setKey(String procInstObserverID)
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.IllegalArgumentException
- if procInstObserverID == null
.public 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 WfXMLMessage
partner
- The partner to which the message will be sent.public void setMessageType(short type)
WfXMLMessage
setMessageType
in class WfXMLMessage
type
- 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.public void setProcessInstanceKey(String processInstanceOid)
processInstanceOid
- oid of the process instance that changed its
state.public String getProcessInstanceKey()
String
containing the process instance key.public 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(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 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.protected Element getDMSParentElem()
WfXMLDocFormMessage
getDMSParentElem
in class WfXMLDocFormMessage
public void setParameter(String parameterName, String parameterValue)
addParameter
method instead.parameterName
- Name of the parameter that you want to set.parameterValue
- The value for the parameter.public void addParameter(String parameterName, String parameterValue)
parameterName
- Name of the parameter for which you want to add a value.parameterValue
- The value for the parameter.public String getParameter(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 Collection<String> listParameterValueStrings(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.@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.