public interface MessageListener
before
methods before an incoming
message will be processed. In the before method you can decide if you want that
the message will be processed or not, by returning a boolean value. If there is
only one listener for an incoming message, the message will be processed if this
listener wants it to be processed or not. If there are more than one listeners,
all listeners must agree to process the request. If one of the listeners vetos,
the request will not be processed and a response message containing a
WfXMLException
will be generated (main code: WfXMLException.WF_OTHER
,
and sub code WfXMLException.WF_OTHER_LISTENER_VETOED
).before
methods have been called and the message may have
been processed (depends on the results of the before
methods), a
after
method is called for some message types. Read the comments for
each method to get more details. Again, the after methods of all registered
listeners will be called. So, e.g., the response can be modified multiple times,
if more than one listener exists.MessageListenerAdapter
and overwrite the methods that you are interested
in.WfXML
class to register and unregister message listeners.Modifier and Type | Method and Description |
---|---|
void |
after(ChangePIStateMessage request,
ProcessInstance pi,
WfXMLMessage response)
This message will be called after a ChangeProcessInstance request has been
processed.
|
void |
after(CreatePIMessage request,
ProcessInstance pi,
WfXMLMessage response)
This message will be called after a CreateProcessInstance request has been
processed (i.e., the process instance and all content have been created).
|
void |
after(GetPIDataMessage request,
ProcessInstance pi,
WfXMLMessage response)
This message will be called after a GetProcessInstanceData request has been
processed.
|
boolean |
before(ChangePIStateMessage request)
A ChangeProcessInstanceState request has arrived.
|
boolean |
before(CreatePIMessage request)
You get a CreateProcessInstance request before it will be processed by the
WfXML layer.
|
boolean |
before(GetPIDataMessage request)
A GetProcessInstanceData request has arrived.
|
boolean |
before(NotifyMessage request)
A Notify message has arrived.
|
boolean |
before(PIStateChangedMessage request)
A ProcessInstanceStateChangedMessage has arrived.
|
WfXMLMessage |
handle(GenericMessage request)
The WfXML layer uses some generic messages for the communication between
active and passive servers.
|
WfXMLMessage handle(GenericMessage request)
handle
method of registered listeners will be called. In this
method you can handle the request and generate an answer message. Return the
answer (which can be any WfXMLMessage
), or null
if you
don't want to return an answer.request
- The incoming request message.GenericMessage
). If you don't want to send a response, simply
return null
.boolean before(CreatePIMessage request)
false
.request
- The incoming CreateProcessInstance request.true
if you want that the WfXML layer processes the
message or false
if the message should not be processed.boolean before(GetPIDataMessage request)
request
- The incoming GetProcessInstanceData request.true
if you want that the WfXML layer processes the
message or false
if the message should not be processed.boolean before(ChangePIStateMessage request)
request
- The incoming ChangeProcessInstanceState request.true
if you want that the WfXML layer processes the
message or false
if the message should not be processed.boolean before(PIStateChangedMessage request)
ProcessInstanceObserver
). You can read the request here and decide
if observers on the local server will be notified about this request or not.
In general you should always let observers be notified.request
- The incoming ProcessInstanceStateChanged request.true
if you want that the WfXML layer passes the
message on to registered ProcessInstanceObserver
s or false
if the message should not be given to observers.boolean before(NotifyMessage request)
request
- The incoming Notify request.true
if you want that the WfXML layer passes the
message on to registered ProcessInstanceObserver
s or false
if the message should not be given to observers.void after(CreatePIMessage request, ProcessInstance pi, WfXMLMessage response)
null
if the requester didn't
require a response.request
- The request that has been processed.pi
- The new process instance.response
- The response message that will be sent back to the requester,
or null
if no response will be sent. The response will be most
likely of type CreatePIMessage
.void after(GetPIDataMessage request, ProcessInstance pi, WfXMLMessage response)
request
- The request message that has been processed.pi
- The process instance of which data has been requested.response
- The response message that will be sent back to the requester.
Here the response message should always be available, because a
GetProcessInstanceData request requests data and so the response returns the
requested data. The response will be of type GetPIDataMessage
in
most cases.void after(ChangePIStateMessage request, ProcessInstance pi, WfXMLMessage response)
request
- The request message that has been processed.pi
- The affected process instance.response
- The response message that will be sent back to the requester.
For this message type the response contains the new process instance state,
so a response should always exist. The response message will be most likely
of type ChangePIStateMessage
.@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.