public class ProcessAndInstanceManagementImpl extends java.lang.Object implements InstanceManagement, ProcessManagement
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.commons.logging.Log |
__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
ManagementExceptions. |
protected <T> T |
dbexec(org.apache.ode.bpel.engine.BpelProcessDatabase.Callable<T> runnable)
Execute a database transaction, unwrapping nested
ManagementExceptions. |
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.
|
InstanceInfoDocument |
suspend(java.lang.Long iid)
Changes the process state from active to suspended. this affects process instances that
are in the active or error states.
|
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.apache.commons.logging.Log __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)
ProcessManagementlistProcessesCustom in interface ProcessManagementfilter - selection filter or null (for no filtering).orderKeys - keys used to order the resultscustom - used to customize the quantity of information returnedProcessInfoDocuments (including instance summaries)public ProcessInfoListDocument listProcesses(java.lang.String filter, java.lang.String orderKeys)
ProcessManagementlistProcesses in interface ProcessManagementfilter - selection filter or null (for no filtering).orderKeys - keys used to order the resultsProcessInfoDocuments (including instance summaries)public ProcessInfoListDocument listAllProcesses()
ProcessManagementlistAllProcesses in interface ProcessManagementProcessInfoDocuments (including instance summaries)public ProcessInfoListDocument listProcessesSummaryOnly()
ProcessManagementlistProcessesSummaryOnly in interface ProcessManagementProcessInfoDocuments (including instance summaries)public ProcessInfoDocument getProcessInfoCustom(javax.xml.namespace.QName pid, ProcessInfoCustomizer custom)
ProcessManagementgetProcessInfoCustom in interface ProcessManagementpid - name of the processcustom - used to customize the quantity of information returnedProcessInfoDocumentpublic ProcessInfoDocument getProcessInfo(javax.xml.namespace.QName pid)
ProcessManagementgetProcessInfo in interface ProcessManagementpid - name of the processProcessInfoDocument with all details.public ProcessInfoDocument activate(javax.xml.namespace.QName pid)
ProcessManagementactivate in interface ProcessManagementpid - identifier for the process to loadProcessInfoDocument reflecting the modificationpublic ProcessInfoDocument setRetired(javax.xml.namespace.QName pid, boolean retired) throws ManagementException
ProcessManagementsetRetired in interface ProcessManagementpid - identifier of the process to retireretired - TODOProcessInfoDocument reflecting the modificationManagementExceptionpublic void setPackageRetired(java.lang.String packageName,
boolean retired)
throws ManagementException
ProcessManagementsetPackageRetired in interface ProcessManagementManagementExceptionpublic ProcessInfoDocument setProcessPropertyNode(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, org.w3c.dom.Node value) throws ManagementException
ProcessManagementsetProcessPropertyNode in interface ProcessManagementpid - name of processpropertyName - qname of propertyvalue - property valueProcessInfoDocument reflecting the modificationManagementExceptionpublic ProcessInfoDocument setProcessProperty(javax.xml.namespace.QName pid, javax.xml.namespace.QName propertyName, java.lang.String value) throws ManagementException
ProcessManagementsetProcessProperty in interface ProcessManagementpid - name of processpropertyName - qname of propertyvalue - property valueProcessInfoDocument reflecting the modificationManagementExceptionpublic 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 InstanceManagementfilter - filter stringorder - order keyslimit - maximum number of instances to returnpublic InstanceInfoListDocument listInstancesSummary(java.lang.String filter, java.lang.String order, int limit)
InstanceManagementlistInstancesSummary in interface InstanceManagementfilter - See listInstances' filter argumentorder - See listInstances' order argumentlimit - maximum number of instances to returnpublic InstanceInfoListDocument listAllInstances()
InstanceManagementlistAllInstances in interface InstanceManagementInstanceManagement.listInstances(String, String, int)public InstanceInfoListDocument listAllInstancesWithLimit(int limit)
InstanceManagementlimit instances in the default (database) order.listAllInstancesWithLimit in interface InstanceManagementlimit - maximum number of instances to returnInstanceManagement.listInstances(String, String, int)public InstanceInfoDocument getInstanceInfo(java.lang.Long iid) throws InstanceNotFoundException
InstanceManagementgetInstanceInfo in interface InstanceManagementInstanceNotFoundException - TODOpublic ScopeInfoDocument getScopeInfo(java.lang.String siid)
InstanceManagementgetScopeInfo in interface InstanceManagementsiid - scope instance identifierInstanceManagement.getScopeInfoWithActivity(String, boolean)public ScopeInfoDocument getScopeInfoWithActivity(java.lang.String siid, boolean includeActivityInfo)
InstanceManagementgetScopeInfoWithActivity in interface InstanceManagementsiid - scope instance identifierincludeActivityInfo - if true, include activity infopublic VariableInfoDocument getVariableInfo(java.lang.String scopeId, java.lang.String varName) throws ManagementException
InstanceManagementgetVariableInfo in interface InstanceManagementscopeId - scope identifiervarName - variable nameManagementExceptionpublic InstanceInfoDocument fault(java.lang.Long iid, javax.xml.namespace.QName faultname, org.w3c.dom.Element faultData)
InstanceManagementfault in interface InstanceManagementiid - instance idfaultname - name of the faultfaultData - fault datapublic InstanceInfoDocument resume(java.lang.Long iid)
InstanceManagementresume in interface InstanceManagementiid - instance idpublic InstanceInfoDocument suspend(java.lang.Long iid) throws ManagementException
InstanceManagementsuspend in interface InstanceManagementiid - instance idManagementExceptionpublic InstanceInfoDocument terminate(java.lang.Long iid) throws ManagementException
InstanceManagementterminate in interface InstanceManagementiid - instance idManagementExceptionpublic InstanceInfoDocument recoverActivity(java.lang.Long iid, java.lang.Long aid, java.lang.String action)
InstanceManagementrecoverActivity in interface InstanceManagementiid - instance id (process)action - recovery action (e.g. retry, fault)public java.util.Collection<java.lang.Long> delete(java.lang.String filter)
InstanceManagementdelete in interface InstanceManagementfilter - instance filter (see InstanceManagement.listInstances(String, String, int) ).public java.util.List<java.lang.String> getEventTimeline(java.lang.String instanceFilter,
java.lang.String eventFilter)
InstanceManagementgetEventTimeline in interface InstanceManagementinstanceFilter - 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)
InstanceManagementInstanceManagement.listInstances(String, String, int) method. The "event filter" employs
a similar syntax; the following properties may be filtered: listEvents in interface InstanceManagementinstanceFilter - 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)
ProcessManagementgetExtensibilityElements in interface ProcessManagementpid - process identifieraids - activity indentifiersActivityExtInfoListDocumentprotected 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 identifierManagementExceptionprotected 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 identifierManagementExceptionprotected <T> T dbexec(org.apache.ode.bpel.engine.BpelProcessDatabase.Callable<T> runnable)
throws ManagementException
ManagementExceptions.runnable - action to runManagementExceptionprotected <T> T dbexec(BpelDatabase.Callable<T> callable) throws ManagementException
ManagementExceptions.callable - action to runManagementExceptionpublic InstanceInfoListDocument queryInstances(java.lang.String query)
queryInstances in interface InstanceManagementInstanceManagement.queryInstances(java.lang.String)public ReplayResponseDocument replay(Replay request) throws ManagementException
ManagementExceptionpublic GetCommunicationResponseDocument getCommunication(GetCommunication request) throws ManagementException
ManagementException