use of org.wso2.carbon.humantask.core.engine.commands.Resume in project carbon-business-process by wso2.
the class InstanceManagementServiceSkeleton method resumeInstance.
/**
* Resume a suspended instance
*
* @param iid Instance Id
* @throws InstanceManagementException If the instance cannot be resumed due to the
* unavailability of Debugger support
*/
public void resumeInstance(long iid) throws InstanceManagementException {
try {
isOperationIsValidForTheCurrentTenant(iid);
} catch (IllegalAccessException ex) {
handleError(ex);
}
/*
We need debugger support in order to resume (since we have to force
a reduction. If one is not available the getDebugger() method should
throw a ProcessingException
*/
DebuggerSupport debugSupport = getDebugger(iid);
if (debugSupport == null) {
String errMsg = "Cannot resume the instance " + iid + ", Debugger support not available";
log.error(errMsg);
throw new InstanceManagementException(errMsg);
}
debugSupport.resume(iid);
}
use of org.wso2.carbon.humantask.core.engine.commands.Resume in project siddhi by wso2.
the class SiddhiAppRuntime method persist.
public PersistenceReference persist() {
try {
// first, pause all the event sources
sourceMap.values().forEach(list -> list.forEach(Source::pause));
// take snapshots of execution units
byte[] snapshots = siddhiAppContext.getSnapshotService().snapshot();
// start the snapshot persisting task asynchronously
AsyncSnapshotPersistor asyncSnapshotPersistor = new AsyncSnapshotPersistor(snapshots, siddhiAppContext.getSiddhiContext().getPersistenceStore(), siddhiAppContext.getName());
String revision = asyncSnapshotPersistor.getRevision();
Future future = siddhiAppContext.getExecutorService().submit(asyncSnapshotPersistor);
return new PersistenceReference(future, revision);
} finally {
// at the end, resume the event sources
sourceMap.values().forEach(list -> list.forEach(Source::resume));
}
}
use of org.wso2.carbon.humantask.core.engine.commands.Resume in project carbon-business-process by wso2.
the class TaskOperationsImpl method resume.
/**
* Resume a suspended task.
*
* @param taskId : task identifier
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void resume(final URI taskId) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
try {
validateTaskId(taskId);
HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {
public Object call() throws Exception {
HumanTaskCommand resumeCommand = new Resume(getCaller(), new Long(taskId.toString()));
resumeCommand.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
Aggregations