Search in sources :

Example 51 with TaskDAO

use of org.wso2.carbon.humantask.core.dao.TaskDAO in project carbon-business-process by wso2.

the class Skip method checkPreConditions.

/**
 * Checks the Pre-conditions before executing the task operation.
 */
@Override
protected void checkPreConditions() {
    TaskDAO task = getTask();
    checkForValidTask();
    if (!task.isSkipable()) {
        throw new HumanTaskRuntimeException(String.format("The task[id:%d] is not a skippable task.", task.getId()));
    }
}
Also used : TaskDAO(org.wso2.carbon.humantask.core.dao.TaskDAO) HumanTaskRuntimeException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)

Example 52 with TaskDAO

use of org.wso2.carbon.humantask.core.dao.TaskDAO in project carbon-business-process by wso2.

the class UpdateComment method execute.

@Override
public void execute() {
    authorise();
    TaskDAO task = getTask();
    checkPreConditions();
    checkState();
    task.updateAndPersistComment(updatingCommentId, updatedCommentString, getOperationInvoker().getName());
    processTaskEvent();
    checkPostConditions();
}
Also used : TaskDAO(org.wso2.carbon.humantask.core.dao.TaskDAO)

Example 53 with TaskDAO

use of org.wso2.carbon.humantask.core.dao.TaskDAO in project carbon-business-process by wso2.

the class TaskCreationContext method injectExpressionEvaluationContext.

public void injectExpressionEvaluationContext(TaskDAO task) {
    if (taskConfiguration == null) {
        throw new RuntimeException("The task configuration is empty in the task creation context");
    }
    EvaluationContext evaluationContext = new ExpressionEvaluationContext(task, this.getTaskConfiguration());
    this.setEvalContext(evaluationContext);
}
Also used : ExpressionEvaluationContext(org.wso2.carbon.humantask.core.engine.runtime.ExpressionEvaluationContext) ExpressionEvaluationContext(org.wso2.carbon.humantask.core.engine.runtime.ExpressionEvaluationContext) EvaluationContext(org.wso2.carbon.humantask.core.engine.runtime.api.EvaluationContext)

Aggregations

TaskDAO (org.wso2.carbon.humantask.core.dao.TaskDAO)27 HumanTaskRuntimeException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)16 HumanTaskEngine (org.wso2.carbon.humantask.core.engine.HumanTaskEngine)7 HumanTaskIllegalAccessException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException)7 HumanTaskIllegalStateException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException)7 RegistryException (org.wso2.carbon.registry.core.exceptions.RegistryException)7 UserStoreException (org.wso2.carbon.user.core.UserStoreException)7 Element (org.w3c.dom.Element)6 HumanTaskDAOConnection (org.wso2.carbon.humantask.core.dao.HumanTaskDAOConnection)6 HumanTaskException (org.wso2.carbon.humantask.core.engine.HumanTaskException)6 HumanTaskIllegalArgumentException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException)6 QName (javax.xml.namespace.QName)5 HumanTaskBaseConfiguration (org.wso2.carbon.humantask.core.store.HumanTaskBaseConfiguration)5 TaskConfiguration (org.wso2.carbon.humantask.core.store.TaskConfiguration)5 HumanTaskIllegalOperationException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException)4 URI (org.apache.axis2.databinding.types.URI)3 NodeList (org.w3c.dom.NodeList)3 PeopleQueryEvaluator (org.wso2.carbon.humantask.core.engine.PeopleQueryEvaluator)3 ExpressionEvaluationContext (org.wso2.carbon.humantask.core.engine.runtime.ExpressionEvaluationContext)3 EvaluationContext (org.wso2.carbon.humantask.core.engine.runtime.api.EvaluationContext)3