public class WorkletGatewayClient extends Interface_Client
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_wsURI |
Constructor and Description |
---|
WorkletGatewayClient()
Constructor - uses default uri on localhost
|
WorkletGatewayClient(java.lang.String uri)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addListener(java.lang.String listenerURI,
java.lang.String handle)
Adds a listener for worklet events (selection, exception raising)
|
java.lang.String |
addNode(java.lang.String processName,
java.lang.String taskID,
RuleType rType,
RdrNode node,
java.lang.String handle)
Adds a node to a ruleSet.
|
java.lang.String |
addNode(WorkItemRecord wir,
RuleType rType,
RdrNode node,
java.lang.String handle)
Adds a node to a ruleSet.
|
java.lang.String |
addNode(YSpecificationID specID,
java.lang.String taskID,
RuleType rType,
RdrNode node,
java.lang.String handle)
Adds a node to a ruleSet.
|
java.lang.String |
addRdrSet(java.lang.String processName,
java.lang.String ruleSetXML,
java.lang.String handle)
Adds a complete (legacy) rule set, expressed as xml
|
java.lang.String |
addRdrSet(YSpecificationID specID,
java.lang.String ruleSetXML,
java.lang.String handle)
Adds a complete (legacy) rule set, expressed as xml
|
java.lang.String |
addWorklet(YSpecificationID specID,
java.lang.String workletXML,
java.lang.String handle)
Adds a worklet to the service repertoire
|
java.lang.String |
checkConnection(java.lang.String handle)
Check that a session handle is active
|
java.lang.String |
connect(java.lang.String userID,
java.lang.String password)
Connects an external entity to the worklet service
|
void |
disconnect(java.lang.String handle)
Disconnects an external entity from the worklet service
|
java.lang.String |
evaluate(java.lang.String processName,
java.lang.String taskID,
Element data,
RuleType rType,
java.lang.String handle)
Evaluates a data set against the rule tree for a process and task, and
returns the conclusion, if any.
|
java.lang.String |
evaluate(WorkItemRecord wir,
Element data,
RuleType rType,
java.lang.String handle)
Evaluates a data set against the rule tree for a specification and task, and
returns the conclusion, if any.
|
java.lang.String |
evaluate(YSpecificationID specID,
java.lang.String taskID,
Element data,
RuleType rType,
java.lang.String handle)
Evaluates a data set against the rule tree for a specification and task, and
returns the conclusion, if any.
|
java.lang.String |
execute(WorkItemRecord wir,
RuleType rType,
RdrConclusion conclusion,
java.util.Set<java.lang.String> workletSet,
java.lang.String handle)
Raises an exception and executes the exception handler defined in an RdrConclusion.
|
java.lang.String |
execute(WorkItemRecord wir,
RuleType rType,
RdrConclusion conclusion,
java.lang.String handle)
Raises an exception and executes the exception handler defined in an RdrConclusion.
|
java.lang.String |
execute(WorkItemRecord wir,
RuleType rType,
RdrConclusion conclusion,
java.lang.String workletXML,
java.lang.String handle)
Raises an exception and executes the exception handler defined in an RdrConclusion.
|
java.lang.String |
getNode(long nodeID,
java.lang.String handle)
Gets a copy of a particular node from a rule set
|
java.lang.String |
getOrphanedWorklets(java.lang.String handle)
Gets an info set of all stored worklets that are not referenced by any rule
|
java.lang.String |
getRdrSet(java.lang.String processName,
java.lang.String handle)
Gets a copy of a particular rule set
|
java.lang.String |
getRdrSet(YSpecificationID specID,
java.lang.String handle)
Gets a copy of a particular rule set
|
java.lang.String |
getRdrSetIDs(java.lang.String handle)
Gets the identifiers for all rule sets
|
java.lang.String |
getRdrTree(java.lang.String processName,
java.lang.String taskID,
RuleType rType,
java.lang.String handle)
Gets a copy of a particular rule tree
|
java.lang.String |
getRdrTree(WorkItemRecord wir,
RuleType rType,
java.lang.String handle)
Gets a copy of a particular rule tree
|
java.lang.String |
getRdrTree(YSpecificationID specID,
java.lang.String taskID,
RuleType rType,
java.lang.String handle)
Gets a copy of a particular rule tree
|
java.lang.String |
getRunningWorklets(java.lang.String handle)
Gets an info set of all currently running worklets
|
java.lang.String |
getWorklet(YSpecificationID specID,
java.lang.String handle)
Gets the specified worklet, if loaded in the service
|
java.lang.String |
getWorkletInfoList(java.lang.String handle)
Gets a list of specification descriptors of all the worklets in the repository
|
java.lang.String |
getWorkletNames(java.lang.String handle)
Gets a list of the names of all the worklets in the repository
|
java.lang.String |
loadFile(java.lang.String path,
java.lang.String extn,
java.lang.String handle)
Loads a file or files into the worklet repository.
|
java.lang.String |
process(WorkItemRecord wir,
Element data,
RuleType rType,
java.lang.String handle)
Evaluates a data set against the rule tree for a specification and task, and
if a rule node is satisfied raises an exception and executes the exception handler
for the node, if one is defined.
|
java.lang.String |
refresh(YSpecificationID specID,
java.lang.String handle)
Refreshes the internal rules cache from storage for a specification
|
java.lang.String |
removeListener(java.lang.String listenerURI,
java.lang.String handle)
Removes a listener for worklet events
|
java.lang.String |
removeNode(YSpecificationID specID,
java.lang.String taskID,
RuleType rType,
long nodeID,
java.lang.String handle)
Removes a rule node from a rule tree, triggers a tree restructure
|
java.lang.String |
removeRdrSet(java.lang.String identifier,
java.lang.String handle)
Removes a rule set
|
java.lang.String |
removeRdrSet(YSpecificationID specID,
java.lang.String handle)
Removes a rule set
|
java.lang.String |
removeWorklet(java.lang.String specKey,
java.lang.String handle)
Gets the specified worklet, if loaded in the service
|
java.lang.String |
removeWorklet(YSpecificationID specID,
java.lang.String handle)
Gets the specified worklet, if loaded in the service
|
java.lang.String |
replaceWorklet(java.lang.String itemID,
java.lang.String handle)
Replaces a worklet instance (or instances) started for a work item with a new
instance (or instances), based on a 'pre' updated rule set
|
java.lang.String |
replaceWorklet(java.lang.String caseID,
java.lang.String itemID,
RuleType ruleType,
java.lang.String handle)
Replaces a worklet instance (or instances) started for an exlet with a new
instance (or instances), based on a 'pre' updated rule set
|
void |
setURI(java.lang.String uri)
Sets the uri of the Worklet Service Gateway
|
java.lang.String |
updateRdrSetTaskIDs(YSpecificationID specID,
java.util.Map<java.lang.String,java.lang.String> updateMap,
java.lang.String handle)
Updates the task ids in a rule set for those they have been changed to via
a specification edit
|
executeGet, executePost, getReply, initPostConnection, prepareParamMap, send, setReadTimeout, stripOuterElement, successful
public WorkletGatewayClient(java.lang.String uri)
uri
- the uri of the Worklet Service Gatewaypublic WorkletGatewayClient()
public void setURI(java.lang.String uri)
uri
- the uri to setpublic java.lang.String connect(java.lang.String userID, java.lang.String password) throws java.io.IOException
userID
- the useridpassword
- the corresponding passwordjava.io.IOException
- if the service can't be reachedpublic java.lang.String checkConnection(java.lang.String handle) throws java.io.IOException
handle
- the session handle to checkjava.io.IOException
- if the service can't be reachedpublic void disconnect(java.lang.String handle) throws java.io.IOException
handle
- the session handle to disconnectjava.io.IOException
- if the service can't be reachedpublic java.lang.String addListener(java.lang.String listenerURI, java.lang.String handle) throws java.io.IOException
listenerURI
- the URI of the listener to addhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String removeListener(java.lang.String listenerURI, java.lang.String handle) throws java.io.IOException
listenerURI
- the URI of the listener to removehandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String refresh(YSpecificationID specID, java.lang.String handle) throws java.io.IOException
specID
- the specification id to refresh the rule set forhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String process(WorkItemRecord wir, Element data, RuleType rType, java.lang.String handle) throws java.io.IOException
wir
- the workitem containing specification and task identifiers. PRE: the
workitem must currently exist in the enginedata
- the data set to use in the evaluationrType
- the type of rule tree to evaluate. NOTE: Only ItemAbort and
ItemConstraintViolation rules can be used with this methodhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String evaluate(WorkItemRecord wir, Element data, RuleType rType, java.lang.String handle) throws java.io.IOException
wir
- the workitem containing specification and task identifiersdata
- the data set to use in the evaluationrType
- the type of rule tree to evaluatehandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String evaluate(YSpecificationID specID, java.lang.String taskID, Element data, RuleType rType, java.lang.String handle) throws java.io.IOException
specID
- the specification identifiertaskID
- the task identifier (may be null for case-level rule types)data
- the data set to use in the evaluationrType
- the type of rule tree to evaluatehandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String evaluate(java.lang.String processName, java.lang.String taskID, Element data, RuleType rType, java.lang.String handle) throws java.io.IOException
processName
- the process identifier, or unique ruleset nametaskID
- the task identifier (may be null for case-level rule types)data
- the data set to use in the evaluationrType
- the type of rule tree to evaluatehandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String execute(WorkItemRecord wir, RuleType rType, RdrConclusion conclusion, java.lang.String handle) throws java.io.IOException
wir
- the workitem containing specification and task identifiers. PRE: the
workitem must currently exist in the enginerType
- the type of rule tree to evaluate. NOTE: Case-level exception types
cannot be used with this methodconclusion
- the RdrConclusion object that defines the exlet to executehandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String execute(WorkItemRecord wir, RuleType rType, RdrConclusion conclusion, java.util.Set<java.lang.String> workletSet, java.lang.String handle) throws java.io.IOException
wir
- the workitem containing specification and task identifiers. PRE: the
workitem must currently exist in the enginerType
- the type of rule tree to evaluate. NOTE: Case-level exception types
cannot be used with this methodconclusion
- the RdrConclusion object that defines the exlet to executeworkletSet
- a set of worklet specifications to be loaded into the engine
for use as compensation handlers during the exception handlinghandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String execute(WorkItemRecord wir, RuleType rType, RdrConclusion conclusion, java.lang.String workletXML, java.lang.String handle) throws java.io.IOException
wir
- the workitem containing specification and task identifiers. PRE: the
workitem must currently exist in the enginerType
- the type of rule tree to evaluate. NOTE: Case-level exception types
cannot be used with this methodconclusion
- the RdrConclusion object that defines the exlet to executeworkletXML
- a worklet specification to be loaded into the engine
for use as a compensation handler during the exception handlinghandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String addNode(WorkItemRecord wir, RuleType rType, RdrNode node, java.lang.String handle) throws java.io.IOException
wir
- the workitem containing specification and task identifiersrType
- the type of rule tree to add the node tonode
- the node to add. It is not required that values are given for id,
parent, true child or false child - these will be calculated and
incorporated when the node is added. It is necessary that
values are given for condition, conclusion and particularly
cornerstone data, which is used to determine the correct place to
insert the node within the tree. Not supplying these values will
produce unpredictable resultshandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String addNode(YSpecificationID specID, java.lang.String taskID, RuleType rType, RdrNode node, java.lang.String handle) throws java.io.IOException
specID
- the specification identifiertaskID
- the task identifier (may be null for case-level rule types)rType
- the type of rule tree to add the node tonode
- the node to add. It is not required that values are given for id,
parent, true child or false child - these will be calculated and
incorporated when the node is added. It is necessary that
values are given for condition, conclusion and particularly
cornerstone data, which is used to determine the correct place to
insert the node within the tree. Not supplying these values will
produce unpredictable resultshandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String addNode(java.lang.String processName, java.lang.String taskID, RuleType rType, RdrNode node, java.lang.String handle) throws java.io.IOException
processName
- the process identifier, or unique ruleset nametaskID
- the task identifier (may be null for case-level rule types)rType
- the type of rule tree to add the node tonode
- the node to add. It is not required that values are given for id,
parent, true child or false child - these will be calculated and
incorporated when the node is added. It is necessary that
values are given for condition, conclusion and particularly
cornerstone data, which is used to determine the correct place to
insert the node within the tree. Not supplying these values will
produce unpredictable resultshandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getNode(long nodeID, java.lang.String handle) throws java.io.IOException
nodeID
- the (integer) node idhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String removeNode(YSpecificationID specID, java.lang.String taskID, RuleType rType, long nodeID, java.lang.String handle) throws java.io.IOException
specID
- the specification identifiertaskID
- the task identifier (may be null for case-level rule types)rType
- the type of rule tree to get the node fromhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getRdrTree(WorkItemRecord wir, RuleType rType, java.lang.String handle) throws java.io.IOException
wir
- the workitem containing specification and task identifiersrType
- the type of rule tree to get the node fromhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getRdrTree(YSpecificationID specID, java.lang.String taskID, RuleType rType, java.lang.String handle) throws java.io.IOException
specID
- the specification identifiertaskID
- the task identifier (may be null for case-level rule types)rType
- the type of rule tree to get the node fromhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getRdrTree(java.lang.String processName, java.lang.String taskID, RuleType rType, java.lang.String handle) throws java.io.IOException
processName
- the process identifier, or unique ruleset nametaskID
- the task identifier (may be null for case-level rule types)rType
- the type of rule tree to get the node fromhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getRdrSet(YSpecificationID specID, java.lang.String handle) throws java.io.IOException
specID
- the specification identifierhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getRdrSet(java.lang.String processName, java.lang.String handle) throws java.io.IOException
processName
- the process identifier, or unique ruleset namehandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getRdrSetIDs(java.lang.String handle) throws java.io.IOException
handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String addRdrSet(YSpecificationID specID, java.lang.String ruleSetXML, java.lang.String handle) throws java.io.IOException
specID
- the id of the specification the rule set is defined forruleSetXML
- the rule set to addhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String addRdrSet(java.lang.String processName, java.lang.String ruleSetXML, java.lang.String handle) throws java.io.IOException
processName
- the name of the process the rule set is defined forruleSetXML
- the rule set to addhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String removeRdrSet(YSpecificationID specID, java.lang.String handle) throws java.io.IOException
specID
- the specification id of the rule set to removehandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String removeRdrSet(java.lang.String identifier, java.lang.String handle) throws java.io.IOException
identifier
- the id of the rule set to removehandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getWorklet(YSpecificationID specID, java.lang.String handle) throws java.io.IOException
specID
- the Worklet specification idhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String addWorklet(YSpecificationID specID, java.lang.String workletXML, java.lang.String handle) throws java.io.IOException
specID
- the Worklet specification idworkletXML
- the worklet specification (as XML) to addhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String replaceWorklet(java.lang.String itemID, java.lang.String handle) throws java.io.IOException
itemID
- the item id of the parent that launched the worklet(s)handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String replaceWorklet(java.lang.String caseID, java.lang.String itemID, RuleType ruleType, java.lang.String handle) throws java.io.IOException
caseID
- the parent case iditemID
- the item id of the parent that launched the worklet(s). May be null
(if case level exception)handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String removeWorklet(java.lang.String specKey, java.lang.String handle) throws java.io.IOException
specKey
- the Worklet specification id keyhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String removeWorklet(YSpecificationID specID, java.lang.String handle) throws java.io.IOException
specID
- the Worklet specification idhandle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getWorkletNames(java.lang.String handle) throws java.io.IOException
handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getWorkletInfoList(java.lang.String handle) throws java.io.IOException
handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getRunningWorklets(java.lang.String handle) throws java.io.IOException
handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String getOrphanedWorklets(java.lang.String handle) throws java.io.IOException
handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String loadFile(java.lang.String path, java.lang.String extn, java.lang.String handle) throws java.io.IOException
path
- the file path to loadextn
- one of '.xrs' (for a rules file) or '.yawl' (for a worklet file)handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedpublic java.lang.String updateRdrSetTaskIDs(YSpecificationID specID, java.util.Map<java.lang.String,java.lang.String> updateMap, java.lang.String handle) throws java.io.IOException
specID
- the specification id for the rule set to updateupdateMap
- the map of changes [oldID -> newID]handle
- a current session handle to the worklet servicejava.io.IOException
- if the service can't be reachedCopyright © 2004-2014 The YAWL Foundation.