use of org.wso2.carbon.humantask.core.engine.commands.SetFault in project carbon-business-process by wso2.
the class TaskOperationsImpl method setFault.
/**
* Set the fault data of the task.
* @param taskIdURI : task identifier
* @param tFault fault – contains the fault name and fault data
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void setFault(final URI taskIdURI, final TFault tFault) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
try {
final Long taskId = validateTaskId(taskIdURI);
HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {
public Object call() throws Exception {
String faultName = null;
Element faultData = null;
if (tFault != null) {
faultName = tFault.getFaultName().toString();
faultData = DOMUtils.getElementFromObject(tFault.getFaultData());
}
SetFault setFault = new SetFault(getCaller(), taskId, faultName, faultData);
setFault.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
Aggregations