use of org.wso2.carbon.humantask.client.api.IllegalAccessFault in project carbon-business-process by wso2.
the class TaskOperationsImpl method nominate.
/**
* Nominate an organization entity to process the task. (An Administrative Operation)
* @param taskIdURI : task identifier
* @param nomineeOrgEntity : TOrganizationalEntity
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void nominate(final URI taskIdURI, final TOrganizationalEntity nomineeOrgEntity) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
try {
final Long taskId = validateTaskId(taskIdURI);
HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {
public Object call() throws Exception {
List<OrganizationalEntityDAO> nominees = TransformerUtils.transformOrganizationalEntityList(nomineeOrgEntity);
Nominate nominateCommand = new Nominate(getCaller(), taskId, nominees);
nominateCommand.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
use of org.wso2.carbon.humantask.client.api.IllegalAccessFault in project carbon-business-process by wso2.
the class TaskOperationsImpl method setPriority.
/**
* Change the priority of the task.
* @param taskIdURI : task identifier
* @param tPriority : The WS-HumanTask Client MUST specify the integer value of the new priority.
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void setPriority(final URI taskIdURI, final TPriority tPriority) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
if (tPriority.getTPriority().intValue() < 1 || tPriority.getTPriority().intValue() > 10) {
log.warn("The priority value should be between 1 and 10. " + "Hence ignoring the provided priority :" + tPriority.getTPriority());
}
try {
final Long taskId = validateTaskId(taskIdURI);
HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {
public Object call() throws Exception {
int newPriority = tPriority.getTPriority().intValue();
SetPriority setPriorityCommand = new SetPriority(getCaller(), taskId, newPriority);
setPriorityCommand.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
use of org.wso2.carbon.humantask.client.api.IllegalAccessFault 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);
}
}
use of org.wso2.carbon.humantask.client.api.IllegalAccessFault in project carbon-business-process by wso2.
the class TaskOperationsImpl method updateComment.
/**
* Updates the identified comment with the supplied new text.
* @param taskIdURI : task identifier
* @param commentId : comment identifier
* @param s : new comment in plain text.
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void updateComment(final URI taskIdURI, final URI commentId, final String s) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
try {
final Long taskId = validateTaskId(taskIdURI);
HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {
public Object call() throws Exception {
UpdateComment updateCommentCommand = new UpdateComment(getCaller(), taskId, new Long(commentId.toString()), s);
updateCommentCommand.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
use of org.wso2.carbon.humantask.client.api.IllegalAccessFault in project carbon-business-process by wso2.
the class TaskOperationsImpl method fail.
/**
* Execution of the task fails
* @param taskIdURI : task identifier
* @param tFault
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void fail(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());
}
Fail failCommand = new Fail(getCaller(), taskID, faultName, faultData);
failCommand.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
Aggregations