public class ProcessAndInstanceManagementImpl extends java.lang.Object implements InstanceManagement, ProcessManagement
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
__log |
protected static Messages |
__msgs |
protected static org.apache.ode.bpel.engine.ProcessStatusConverter |
__psc |
protected java.util.Calendar |
_calendar |
protected BpelDatabase |
_db |
protected BpelServerImpl |
_server |
protected ProcessStore |
_store |
Constructor and Description |
---|
ProcessAndInstanceManagementImpl(BpelServer server,
ProcessStore store) |
Modifier and Type | Method and Description |
---|---|
ProcessInfoDocument |
activate(javax.xml.namespace.QName pid)
Activate a process.
|
protected <T> T |
dbexec(BpelDatabase.Callable<T> callable)
Execute a database transaction, unwrapping nested
ManagementException s. |
protected <T> T |
dbexec(org.apache.ode.bpel.engine.BpelProcessDatabase.Callable<T> runnable)
Execute a database transaction, unwrapping nested
ManagementException s. |
java.util.Collection<java.lang.Long> |
delete(java.lang.String filter)
Delete the process instances matching the given filter.
|
InstanceInfoDocument |
fault(java.lang.Long iid,
javax.xml.namespace.QName faultname,
org.w3c.dom.Element faultData)
Causes the process instance to complete unsuccessfully by throwing the specified
fault in the global scope.
|
GetCommunicationResponseDocument |
getCommunication(GetCommunication request) |
protected DebuggerSupport |
getDebugger(java.lang.Long iid)
Get the
DebuggerSupport object for the given instance identifier. |
protected DebuggerSupport |
getDebugger(javax.xml.namespace.QName procid)
Get the
DebuggerSupport object for the given process identifier. |
java.util.List<java.lang.String> |
getEventTimeline(java.lang.String instanceFilter,
java.lang.String eventFilter)
Retrieve a timeline of BPEL events.
|
ActivityExtInfoListDocument |
getExtensibilityElements(javax.xml.namespace.QName pid,
java.lang.Integer[] aids)
Get all extensibility elements associated with provided activity ids.
|
InstanceInfoDocument |
getInstanceInfo(java.lang.Long iid)
Get an instance by id.
|
ProcessInfoDocument |
getProcessInfo(javax.xml.namespace.QName pid)
Get the process info for a process (includingthe instance summary).
|
ProcessInfoDocument |
getProcessInfoCustom(javax.xml.namespace.QName pid,
ProcessInfoCustomizer custom)
Get the process info for a process.
|
ScopeInfoDocument |
getScopeInfo(java.lang.String siid)
Get info about a scope instance by id, not including activity info.
|
ScopeInfoDocument |
getScopeInfoWithActivity(java.lang.String siid,
boolean includeActivityInfo)
Get info about a scope instance by id, optionally including activity info.
|
VariableInfoDocument |
getVariableInfo(java.lang.String scopeId,
java.lang.String varName)
Get info about a variable.
|
InstanceInfoListDocument |
listAllInstances()
List all instances in the default (database) order.
|
InstanceInfoListDocument |
listAllInstancesWithLimit(int limit)
List up to
limit instances in the default (database) order. |
ProcessInfoListDocument |
listAllProcesses()
List the processes known to the engine.
|
EventInfoListDocument |
listEvents(java.lang.String instanceFilter,
java.lang.String eventFilter,
int maxCount)
Retrieve BPEL events.
|
InstanceInfoListDocument |
listInstances(java.lang.String filter,
java.lang.String order,
int limit)
Retrieve and returns information about all, or some process instances.
|
InstanceInfoListDocument |
listInstancesSummary(java.lang.String filter,
java.lang.String order,
int limit)
List instances and only return summary information about the instance,
combined with all correlation properties.
|
ProcessInfoListDocument |
listProcesses(java.lang.String filter,
java.lang.String orderKeys)
List the processes known to the engine (including instance summaries).
|
ProcessInfoListDocument |
listProcessesCustom(java.lang.String filter,
java.lang.String orderKeys,
ProcessInfoCustomizer custom)
List the processes known to the engine.
|
ProcessInfoListDocument |
listProcessesSummaryOnly()
List the processes known to the engine, excluding the document list, properties and end point configs.
|
InstanceInfoListDocument |
queryInstances(java.lang.String query) |
InstanceInfoDocument |
recoverActivity(java.lang.Long iid,
java.lang.Long aid,
java.lang.String action)
Performs an activity recovery action.
|
ReplayResponseDocument |
replay(Replay request) |
InstanceInfoDocument |
resume(java.lang.Long iid)
Resume the (previously suspended) instance.
|
void |
setPackageRetired(java.lang.String packageName,
boolean retired)
Retires all the processes contained in a package.
|
ProcessInfoDocument |
setProcessProperty(javax.xml.namespace.QName pid,
javax.xml.namespace.QName propertyName,
java.lang.String value)
Set a process property as a simple type.
|
ProcessInfoDocument |
setProcessPropertyNode(javax.xml.namespace.QName pid,
javax.xml.namespace.QName propertyName,
org.w3c.dom.Node value)
Set a process property as a Node.
|
ProcessInfoDocument |
setRetired(javax.xml.namespace.QName pid,
boolean retired)
Retire a process.
|
VariableInfoDocument |
setVariable(java.lang.String scopeId,
java.lang.String varName,
org.apache.xmlbeans.XmlObject value) |
InstanceInfoDocument |
suspend(java.lang.Long iid)
Changes the process state from active to suspended.
|
InstanceInfoDocument |
terminate(java.lang.Long iid)
Causes the process instance to terminate immediately, without a chance to
perform any fault handling or compensation.
|
protected static final Messages __msgs
protected static org.slf4j.Logger __log
protected static final org.apache.ode.bpel.engine.ProcessStatusConverter __psc
protected BpelDatabase _db
protected ProcessStore _store
protected java.util.Calendar _calendar
protected BpelServerImpl _server
public ProcessAndInstanceManagementImpl(BpelServer server, ProcessStore store)
public ProcessInfoListDocument listProcessesCustom(java.lang.String filter, java.lang.String orderKeys, ProcessInfoCustomizer custom)
ProcessManagement
listProcessesCustom
in interface ProcessManagement
filter
- selection filter or null
(for no filtering).orderKeys
- keys used to order the resultscustom
- used to customize the quantity of information returnedProcessInfoDocument
s (including instance summaries)public ProcessInfoListDocument listProcesses(java.lang.String filter, java.lang.String orderKeys)
ProcessManagement
listProcesses
in interface ProcessManagement
filter
- selection filter or null
(for no filtering).orderKeys
- keys used to order the resultsProcessInfoDocument
s (including instance summaries)public ProcessInfoListDocument listAllProcesses()
ProcessManagement
listAllProcesses
in interface ProcessManagement
ProcessInfoDocument
s (including instance summaries)public ProcessInfoListDocument listProcessesSummaryOnly()
ProcessManagement
listProcessesSummaryOnly
in interface ProcessManagement
ProcessInfoDocument
s (including instance summaries)public ProcessInfoDocument getProcessInfoCustom(javax.xml.namespace.QName pid, ProcessInfoCustomizer custom)
ProcessManagement
getProcessInfoCustom
in interface ProcessManagement
pid
- name of the processcustom
- used to customize the quantity of information returnedProcessInfoDocument
public ProcessInfoDocument getProcessInfo(javax.xml.namespace.QName pid)
ProcessManagement
getProcessInfo
in interface ProcessManagement
pid
- name of the processProcessInfoDocument
with all details.public ProcessInfoDocument activate(javax.xml.namespace.QName pid)
ProcessManagement
activate
in interface ProcessManagement
pid
- identifier for the process to loadProcessInfoDocument
reflecting the modificationpublic ProcessInfoDocument setRetired(javax.xml.namespace.QName pid, boolean retired) throws ManagementException
ProcessManagement
setRetired
in interface ProcessManagement
pid
- identifier of the process to retireretired
- TODOProcessInfoDocument
reflecting the modificationManagementException
public void setPackageRetired(java.lang.String packageName, boolean retired) throws ManagementException
ProcessManagement
setPackageRetired
in interface ProcessManagement
ManagementException
public ProcessInfoDocument setProcessPropertyNode(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, org.w3c.dom.Node value) throws ManagementException
ProcessManagement
setProcessPropertyNode
in interface ProcessManagement
pid
- name of processpropertyName
- qname of propertyvalue
- property valueProcessInfoDocument
reflecting the modificationManagementException
public ProcessInfoDocument setProcessProperty(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.String value) throws ManagementException
ProcessManagement
setProcessProperty
in interface ProcessManagement
pid
- name of processpropertyName
- qname of propertyvalue
- property valueProcessInfoDocument
reflecting the modificationManagementException
public InstanceInfoListDocument listInstances(java.lang.String filter, java.lang.String order, int limit)
InstanceManagement
Retrieve and returns information about all, or some process instances.
The request identifies the process instances using a filter that can
select instances with a given name, status, property values, etc.
Without a filter, the operation returns all process instances up to a
specified limit<.code>. The request also indicates which key fields
to use for ordering the results.
The filter element can be used to narrow down the list of process definitions by applying selection criteria. There are six filters that can be applied:
name -- Only process instances with this local name.
namespace -- Only process instances with this namespace URI.
status -- Only process instances with these status code(s).
started -- Only process instances started relative to this date/time.
last-active -- Only process instances last active relative to this date/time.
$property -- Only process instances with a correlation property equal to the specified value.
The name and namespace filters can do full or partial name matching. Partial matching occurs if either filter ends with an asterisk (*). These filters are not case sensitive, for example name=my* will match MyProcess and my-process. If unspecified, the default filter is name=* namespace=*.
The status filter can be used to filter all process definitions based on six status codes:
active -- All currently active process instances (excludes instances in any other state).
suspended -- All process instances that have not completed, but are currently suspended.
error -- All process instances that have not completed, but are currently indicate an error condition.
completed -- All successfully completed process instances (excludes instances in any other state).
terminated -- All process instances that were terminated.
faulted -- All process instances that encountered a fault (in the global scope).
The started filter can be used to filter all process instances started on or after a particular date or date/time instant. The value of this filter is either an ISO-8601 date or ISO-8601 date/time. For example, to find all process instances started on or after September 1, 2005, use started>=20050901. Similarly, the last-active filter can be used to filter all process instances based on their last active time. The last active time records when the process last completed performing work, and either completed or is now waiting to receive a message, a timeout or some other event.
Each process instance has one or more properties that are set its instantiation, that can be used to distinguish it from other process instances. In this version of the specification, we only support properties instantiated as part of correlation sets defined in the global scope of the process. For example, if a process instantiates a correlation set that uses the property order-id, it is possible to filter that process instance based on the value of that property.
The property name is identified by the prefix $. If the property name is an NCName, the filter will match all properties with that local name. If the property name is {namespace}local, the filter will match all properties with the specified namespace URI and local name. For example, to retrieve a list of all active process instances with a property order-id that has the value 456, use status=active $order-id=456.
By default the response returns process instances in no particular order. The order element can be used to order the results by specifying a space-separated list of keys. Each key can be prefixed with a plus sign '+' to specify ascending order, or a '-' minus sign to specify descending order. Without a sign the default behavior is to return process instances in ascending order. The currently supported odering keys are:
pid
name
namespace
version
status
started
last-active
listInstances
in interface InstanceManagement
filter
- filter stringorder
- order keyslimit
- maximum number of instances to returnpublic InstanceInfoListDocument listInstancesSummary(java.lang.String filter, java.lang.String order, int limit)
InstanceManagement
listInstancesSummary
in interface InstanceManagement
filter
- See listInstances' filter argumentorder
- See listInstances' order argumentlimit
- maximum number of instances to returnpublic InstanceInfoListDocument listAllInstances()
InstanceManagement
listAllInstances
in interface InstanceManagement
InstanceManagement.listInstances(String, String, int)
public InstanceInfoListDocument listAllInstancesWithLimit(int limit)
InstanceManagement
limit
instances in the default (database) order.listAllInstancesWithLimit
in interface InstanceManagement
limit
- maximum number of instances to returnInstanceManagement.listInstances(String, String, int)
public InstanceInfoDocument getInstanceInfo(java.lang.Long iid) throws InstanceNotFoundException
InstanceManagement
getInstanceInfo
in interface InstanceManagement
InstanceNotFoundException
- TODOpublic ScopeInfoDocument getScopeInfo(java.lang.String siid)
InstanceManagement
getScopeInfo
in interface InstanceManagement
siid
- scope instance identifierInstanceManagement.getScopeInfoWithActivity(String, boolean)
public ScopeInfoDocument getScopeInfoWithActivity(java.lang.String siid, boolean includeActivityInfo)
InstanceManagement
getScopeInfoWithActivity
in interface InstanceManagement
siid
- scope instance identifierincludeActivityInfo
- if true
, include activity infopublic VariableInfoDocument getVariableInfo(java.lang.String scopeId, java.lang.String varName) throws ManagementException
InstanceManagement
getVariableInfo
in interface InstanceManagement
scopeId
- scope identifiervarName
- variable nameManagementException
public VariableInfoDocument setVariable(java.lang.String scopeId, java.lang.String varName, org.apache.xmlbeans.XmlObject value) throws ManagementException
ManagementException
public InstanceInfoDocument fault(java.lang.Long iid, javax.xml.namespace.QName faultname, org.w3c.dom.Element faultData)
InstanceManagement
fault
in interface InstanceManagement
iid
- instance idfaultname
- name of the faultfaultData
- fault datapublic InstanceInfoDocument resume(java.lang.Long iid)
InstanceManagement
resume
in interface InstanceManagement
iid
- instance idpublic InstanceInfoDocument suspend(java.lang.Long iid) throws ManagementException
InstanceManagement
suspend
in interface InstanceManagement
iid
- instance idManagementException
public InstanceInfoDocument terminate(java.lang.Long iid) throws ManagementException
InstanceManagement
terminate
in interface InstanceManagement
iid
- instance idManagementException
public InstanceInfoDocument recoverActivity(java.lang.Long iid, java.lang.Long aid, java.lang.String action)
InstanceManagement
recoverActivity
in interface InstanceManagement
iid
- instance id (process)action
- recovery action (e.g. retry, fault)public java.util.Collection<java.lang.Long> delete(java.lang.String filter)
InstanceManagement
delete
in interface InstanceManagement
filter
- instance filter (see InstanceManagement.listInstances(String, String, int)
).public java.util.List<java.lang.String> getEventTimeline(java.lang.String instanceFilter, java.lang.String eventFilter)
InstanceManagement
getEventTimeline
in interface InstanceManagement
instanceFilter
- instance filter (if set,return only events for matching instances)eventFilter
- event filter (event type and data range)public EventInfoListDocument listEvents(java.lang.String instanceFilter, java.lang.String eventFilter, int maxCount)
InstanceManagement
InstanceManagement.listInstances(String, String, int)
method. The "event filter" employs
a similar syntax; the following properties may be filtered: listEvents
in interface InstanceManagement
instanceFilter
- instance filter (if set,return only events for matching instances)eventFilter
- event filter (event type and data range)public ActivityExtInfoListDocument getExtensibilityElements(javax.xml.namespace.QName pid, java.lang.Integer[] aids)
ProcessManagement
getExtensibilityElements
in interface ProcessManagement
pid
- process identifieraids
- activity indentifiersActivityExtInfoListDocument
protected final DebuggerSupport getDebugger(javax.xml.namespace.QName procid) throws ManagementException
DebuggerSupport
object for the given process identifier.
Debugger support is required for operations that resume execution in some
way or manipulate the breakpoints.procid
- process identifierManagementException
protected final DebuggerSupport getDebugger(java.lang.Long iid)
DebuggerSupport
object for the given instance identifier.
Debugger support is required for operations that resume execution in some
way or manipulate the breakpoints.iid
- instance identifierManagementException
protected <T> T dbexec(org.apache.ode.bpel.engine.BpelProcessDatabase.Callable<T> runnable) throws ManagementException
ManagementException
s.runnable
- action to runManagementException
protected <T> T dbexec(BpelDatabase.Callable<T> callable) throws ManagementException
ManagementException
s.callable
- action to runManagementException
public InstanceInfoListDocument queryInstances(java.lang.String query)
queryInstances
in interface InstanceManagement
InstanceManagement.queryInstances(java.lang.String)
public ReplayResponseDocument replay(Replay request) throws ManagementException
ManagementException
public GetCommunicationResponseDocument getCommunication(GetCommunication request) throws ManagementException
ManagementException