_userList.checkConnection(sessionHandle);
} catch (YAuthenticationException e) {
return OPEN_FAILURE + e.getMessage() + CLOSE_FAILURE;
}
StringBuffer options = new StringBuffer();
YWorkItem workItem = _engine.getWorkItem(workItemID);
if (workItem != null) {
if (workItem.getStatus().equals(YWorkItem.statusExecuting)) {
options.append("<option operation=\"suspend\">" +
"<documentation>Suspend the currently active workItem</documentation>" +
"<style>post</style>" +
"<url>").append(thisURL).append("?action=suspend</url></option>");
options.append("<option operation=\"complete\">" +
"<documentation>Notify the engine that the work item is complete</documentation>" +
"<style>post</style>" + "<url>").append(thisURL).append("?action=complete</url>" +
"<bodyContent>Any return data needed for this work item.</bodyContent>" +
"</option>");
}
try {
_engine.checkElegibilityToAddInstances(workItemID);
options.append("<option operation=\"addNewInstance\">" +
"<documentation>Add a new Instance similar to this work item</documentation>" +
"<style>post</style>" + "<url>").
append(thisURL).
append("?action=createInstance</url>" +
"<bodyContent>The data for the new instance.</bodyContent>" +
"</option>");
} catch (YAWLException e) {
//just don't provide that option.
if (e instanceof YPersistenceException) {
enginePersistenceFailure = true;
}
}
if (workItem.getStatus().equals(YWorkItem.statusEnabled)
|| workItem.getStatus().equals(YWorkItem.statusFired)) {
options.append("<option operation=\"start\">" +
"<documentation>Starts a work item</documentation>" +
"<style>post</style>" + "<url>").
append(thisURL).
append("?action=startOne&user=[userID]</url>" +