use of org.wso2.carbon.humantask.core.engine.HumanTaskCommand in project carbon-business-process by wso2.
the class TaskOperationsImpl method claim.
/**
* Claim responsibility for a task, i.e. set the task to status Reserved
* @param taskIdURI : task identifier
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void claim(final URI taskIdURI) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
try {
final Long taskId = validateTaskId(taskIdURI);
HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {
public Object call() throws Exception {
HumanTaskCommand claim = new Claim(getCaller(), taskId);
claim.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
use of org.wso2.carbon.humantask.core.engine.HumanTaskCommand in project carbon-business-process by wso2.
the class TaskOperationsImpl method release.
/**
* Release the task, i.e. set the task back to status Ready.
* @param taskId : task identifier
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void release(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 releaseCommand = new Release(getCaller(), new Long(taskId.toString()));
releaseCommand.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
use of org.wso2.carbon.humantask.core.engine.HumanTaskCommand in project carbon-business-process by wso2.
the class TaskOperationsImpl method stop.
/**
* Cancel/stop the processing of the task. The task returns to the Reserved state.
*
* @param taskId : task identifier
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void stop(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 stop = new Stop(getCaller(), new Long(taskId.toString()));
stop.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
use of org.wso2.carbon.humantask.core.engine.HumanTaskCommand in project carbon-business-process by wso2.
the class TaskOperationsImpl method suspend.
/**
* Suspend the task.
*
* @param taskId : task identifier
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void suspend(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 suspendCommand = new Suspend(getCaller(), new Long(taskId.toString()));
suspendCommand.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
use of org.wso2.carbon.humantask.core.engine.HumanTaskCommand 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