use of org.wso2.carbon.humantask.core.engine.commands.SetOutput in project carbon-business-process by wso2.
the class TaskOperationsImpl method setOutput.
/**
* Set the data for the part of the task's output message.
*
* @param taskIdURI : task identifier
* @param ncName : PartName
* @param o
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void setOutput(URI taskIdURI, NCName ncName, Object o) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
try {
final Long taskId = validateTaskId(taskIdURI);
if (ncName != null && o != null) {
final String outputName = ncName.toString();
final Element outputData = DOMUtils.stringToDOM((String) o);
HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {
public Object call() throws Exception {
SetOutput setOutputCommand = new SetOutput(getCaller(), taskId, outputName, outputData);
setOutputCommand.execute();
return null;
}
});
} else {
log.error("The output data for setOutput operation cannot be empty");
throw new IllegalArgumentFault("The output data cannot be empty!");
}
} catch (Exception ex) {
handleException(ex);
}
}
Aggregations