public class CreatePIMessage extends WfXMLDocFormMessage
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 |
CreatePIMessage(Document doc)
This method is used internally for creating a create process instance message
out of a xml document.
|
protected |
CreatePIMessage(Document doc,
boolean justIDs)
That's a special constructor which doesn't try to create user objects out
of the users that are specified in the message.
|
|
CreatePIMessage(short messageType)
Use this method to create a new and empty
CreatePIMessage object. |
Modifier and Type | Method and Description |
---|---|
void |
addParameter(String parameterName,
Element content)
Like
addParameter(String, String) but you
can add whatever you want (complex structures...) with a JDOM
Element here. |
void |
addParameter(String parameterName,
String parameterValue)
Use this method to add a parameter to the ContextData part of the request.
|
void |
addParameter(String parameterName,
WfXMLForm form)
Use this method to add a
WfXMLForm as parameter to this
message. |
String |
getDescription()
Returns the description of request messages.
|
protected Element |
getDMSParentElem()
Get the correct element of the message that wiil contain DMS artefacts;
|
String |
getKeyApplID()
Returns the application ID part of the key.
|
String |
getKeyProcDefID()
Returns the process definition ID part of the key.
|
int |
getKeyVersion()
Returns the version part of the key.
|
String |
getName()
Use this method to get the name of the process instance.
|
String |
getObserverClass()
This method returns the observer class (as String object) which can be set in
CreateProcessInstance request messages.
|
String |
getObserverKey()
This method returns the whole observer key that is set in the message.
|
String |
getParameter(String parameterName)
Use this method to retrieve a simple text parameter, which has been set with
setParameter(String, String) before. |
WfXMLForm |
getParameterForm(String parameterName)
Use this method to retrieve a
WfXMLForm object representing
a form that has been set for or added to the parameter parameterName . |
String |
getProcessInstanceKey()
Use this method to get the process instance key out of response messages.
|
Agent |
getStartParameterAgent()
Returns an
Agent instance representing the user
or role who is specified in the message's start parameters. |
String |
getStartParameterAgentID()
Returns the agent id defined in the start parameters of this CreateProcessInstance
request message.
|
Date |
getStartParameterDueDate()
Use this method to get the due-date which is set in the start parameters of
a CreateProcessInstance request message.
|
OrgUnit |
getStartParameterOrgUnit()
Returns a
OrgUnit instance representing the
organizational unit which is specified in the message's start parameters. |
String |
getStartParameterOrgUnitID()
Returns the organization unit's id defined in the start parameters of this
CreateProcessInstance request message.
|
String |
getSubject()
This method returns the subject for the process instance.
|
Collection<WfXMLForm> |
listParameterForms(String parameterName)
This method returns a
Collection containing
WfXMLForm objects which were set for the given
parameter parameterName . |
Collection<Element> |
listParameterValueElements(String parameterName)
This method returns a
Collection with all
values (as JDOM Element objects) for the given parameter. |
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 is called by the Sender before the message is sent.
|
protected void |
prepare(String targetURL)
This method is used by the WfXML test client only!
|
void |
setDescription(String desc)
A longer description of the purpose for the process instance that will
be created with this message.
|
void |
setKey(String applID,
String procdefID,
int version)
Use this method to set the key for this CreateProcessInstance message.
|
void |
setMessageType(short type)
Set the message type of this WfXML message (in the message header).
|
void |
setName(String name)
Sets the name for the process instance.
|
void |
setObserver(Class<?> observer)
Use this method to set an observer for the process instance that will be
created on the remote server by this CreateProcessInstance request.
|
protected void |
setObserver(String uri)
Setting a dummy observer.
|
void |
setParameter(String parameterName,
Element content)
Similar to
setParameter(String, String)
but you can set your own JDOM Element as content
here. |
void |
setParameter(String parameterName,
String parameterValue)
Use this method for setting a parameter in the ContextData part of request
messages.
|
void |
setParameter(String parameterName,
WfXMLForm form)
Use this method to set a
WfXMLForm as a parameter for this
message. |
void |
setProcessInstanceKey(String procInstOID)
Sets the process instance key of the newly created process instance.
|
void |
setStartParameter(Agent agent,
OrgUnit orgUnit,
Date dueDate)
Use this method to set the start parameters for CreateProcessInstance request
methods.
|
void |
setStartParameter(String agentID,
String agentClassName,
String orgUnitID,
Date dueDate)
This method sets start parameters with which the process instance will be
started.
|
void |
setSubject(String subject)
A subject for the process instance.
|
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 CreatePIMessage(short messageType)
CreatePIMessage
object.
You must specify the type of message (request or response).messageType
- The type of new message you want to create: this can be
either WfXMLMessage.REQUEST
or WfXMLMessage.RESPONSE
.protected CreatePIMessage(Document doc) throws Exception
doc
- JDOM Document containing the content for the message.Exception
protected CreatePIMessage(Document doc, boolean justIDs) throws Exception
doc
- JDOM document with the message content.justIDs
- true
means that just IDs will be used and no
user objects will be created. false
creates user objects.Exception
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 setName(String name)
name
- String containing the name.public String getName()
null
if the message doesn't contain a name.public void setProcessInstanceKey(String procInstOID)
procInstOID
- Unique oid of the process instance.public String getProcessInstanceKey()
null
if there is no process instance key in the message (this also happens if
you call this method on a request message).public void setObserver(Class<?> observer)
NotifyMessage
) and
ProcessInstanceStateChanged (PIStateChangedMessage
) requests.observer
- A class implementing the ProcessInstanceObserver
interface. If you want to remove a previously set observer, provide
null
as parameter.protected void setObserver(String uri)
dummyclass
.uri
- Specifies the uri that should be set in the observer.public String getObserverKey()
null
if the message doesn't contain an observer key (this also happens if you
call this method for a response message).public String getObserverClass() throws WfXMLMessageException
getObserverKey
method would return.null
if no observer was defined.WfXMLMessageException
- if the observer key is not compatible to @enterprise
requirements.public void setSubject(String subject)
subject
- The subject that you wish to be assigned to the process
instance.public String getSubject()
null
if the message
doesn't contain a subject.public void setDescription(String desc)
desc
- String containing the description that you want to add.public String getDescription()
null
if there
is no description. If you call this method for response messages, you will
always receive null
, because this element only occurs in
request messages.public void setKey(String applID, String procdefID, int version)
applID
- Application ID: this parameter is optional and defines the
application in which the process definition is located. If you don't set
this parameter (null
), the default application will be used.procdefID
- Process Definition ID: this is the process ID of the process
that you want to start. You must provide this id.version
- Defines the version of the process. You can provide a positive
integer value for a specific version, or -1
if you want that
the process definition with the highest version number will be instantiated.IllegalArgumentException
- if no process definition ID is defined or version < 0
public void prepare(Partner partner)
prepare
in class WfXMLMessage
partner
- Reference to the Partner
object, which holds the
information about the partner, to which the message will be sent.protected void prepare(String targetURL)
targetURL
- target URL to which the message will be sent.public String getKeyApplID() throws WfXMLMessageException
setKey(String,String,int)
for more details on key parts.WfXMLMessageException
- if any error occurs while reading the key.public String getKeyProcDefID() throws WfXMLMessageException
setKey(String,String,int)
for more details on key parts.WfXMLMessageException
- if any error occurs while reading the key.public int getKeyVersion() throws WfXMLMessageException
setKey(String,String,int)
for more details on key parts.int
value containing the version part of the key, or
-1
if no version has been specified. In this case the newest
version should be used.WfXMLMessageException
- if any error occurs while reading the key.protected Element getDMSParentElem()
WfXMLDocFormMessage
getDMSParentElem
in class WfXMLDocFormMessage
public void setStartParameter(Agent agent, OrgUnit orgUnit, Date dueDate)
agent
- An Agent
object (user or role)
representing the agent who starts the process. If you start the process with a
role, the new process instance will appear in the role worklist of this role.
You can set the agent also to null
if you don't want
to specify an agent for starting the process instance.orgUnit
- A OrgUnit
object representing the
organization unit (department) for which the process will be started.
This value can also be set to null
, but only if the
remote @enterprise server has an interface defined for starting this process.
Interfaces define a relation between form, process definition, and
organizational unit. If you set this parameter to null
the
organizational unit defined in the interface will be used. And if there
is no interface for starting this process, you will get back an exception
message from the remote server.dueDate
- A Date
object containing a date and
time which will be set as due-date for the process instance. If you don't
provide a value for this parameter (null
), no due-date will
be set.public void setStartParameter(String agentID, String agentClassName, String orgUnitID, Date dueDate)
setStartParameter
, with the
only difference that you don't need to provide User
and OrgUnit
objects here. Instead you simply
define the IDs of these parameters.agentID
- String specifying an agent ID. The ID can be the ID of a user
or the ID of a role. Use the agentClassName
parameter for
specifying whether it is a user or a role. Set the agentID
to
null
if you don't want to specify an agent for starting the
process.agentClassName
- Set this value to com.dec.avw.core.User
or com.dec.avw.core.Role
, depending on whether the
agentID
parameter is the ID of a role or of a user. If
agentID
is null
, you can also set this parameter
to null
.orgUnitID
- String specifying a org.unit ID. This value can also be
set to null
, but only if the remote @enterprise server has
an interface defined for starting this process. Interfaces define a relation
between form, process definition, and organizational unit. If you set this
parameter to null
the organizational unit defined in the
interface will be used. And if there is no interface for starting this
process, you will get back an exception message from the remote server.dueDate
- A Date
object containing the due-date
with which the process will be started. This parameter can also be set to
null
.public Date getStartParameterDueDate() throws WfXMLMessageException
Date
object representing the date and time
set in the message's start parameters, or null
if no due-date
has been set in this message. The returned Date
object
contains the time in the local timezone.WfXMLMessageException
- if the date and time defined in this message
don't meet the format requirements defined in the WfXML specification.public OrgUnit getStartParameterOrgUnit()
OrgUnit
instance representing the
organizational unit which is specified in the message's start parameters.OrgUnit
instance of the
organizational unit which is specified in the message's start parameters,
or null
if no org.unit has been defined or if the defined
org.unit does not exist on the local server.public String getStartParameterOrgUnitID()
String
object containing the org.unit's id,
or null
if no org.unit has been defined.public Agent getStartParameterAgent()
Agent
instance representing the user
or role who is specified in the message's start parameters.Agent
instance of the user or role
who is specified in the message's start parameters, or null
if no agent has been defined or if the defined agent does not exist on
the local server.public String getStartParameterAgentID()
String
object containing the agent id, or
null
if no agent has been defined.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 setParameter(String parameterName, 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(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 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.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<WfXMLForm> listParameterForms(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 WfXMLForm getParameterForm(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 Collection<Element> listParameterValueElements(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 parameter is not found, the collection is empty.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 void addParameter(String parameterName, 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(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.@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.