Search in sources :

Example 16 with IllegalAccessFault

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);
    }
}
Also used : Nominate(org.wso2.carbon.humantask.core.engine.commands.Nominate) HumanTaskIllegalArgumentException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException) RegistryException(org.wso2.carbon.registry.core.exceptions.RegistryException) HumanTaskIllegalStateException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException) HumanTaskIllegalOperationException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException) UserStoreException(org.wso2.carbon.user.core.UserStoreException) HumanTaskException(org.wso2.carbon.humantask.core.engine.HumanTaskException) HumanTaskIllegalAccessException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException) HumanTaskRuntimeException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)

Example 17 with IllegalAccessFault

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);
    }
}
Also used : SetPriority(org.wso2.carbon.humantask.core.engine.commands.SetPriority) HumanTaskIllegalArgumentException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException) RegistryException(org.wso2.carbon.registry.core.exceptions.RegistryException) HumanTaskIllegalStateException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException) HumanTaskIllegalOperationException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException) UserStoreException(org.wso2.carbon.user.core.UserStoreException) HumanTaskException(org.wso2.carbon.humantask.core.engine.HumanTaskException) HumanTaskIllegalAccessException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException) HumanTaskRuntimeException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)

Example 18 with IllegalAccessFault

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);
    }
}
Also used : SetFault(org.wso2.carbon.humantask.core.engine.commands.SetFault) Element(org.w3c.dom.Element) HumanTaskIllegalArgumentException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException) RegistryException(org.wso2.carbon.registry.core.exceptions.RegistryException) HumanTaskIllegalStateException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException) HumanTaskIllegalOperationException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException) UserStoreException(org.wso2.carbon.user.core.UserStoreException) HumanTaskException(org.wso2.carbon.humantask.core.engine.HumanTaskException) HumanTaskIllegalAccessException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException) HumanTaskRuntimeException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)

Example 19 with IllegalAccessFault

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);
    }
}
Also used : UpdateComment(org.wso2.carbon.humantask.core.engine.commands.UpdateComment) HumanTaskIllegalArgumentException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException) RegistryException(org.wso2.carbon.registry.core.exceptions.RegistryException) HumanTaskIllegalStateException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException) HumanTaskIllegalOperationException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException) UserStoreException(org.wso2.carbon.user.core.UserStoreException) HumanTaskException(org.wso2.carbon.humantask.core.engine.HumanTaskException) HumanTaskIllegalAccessException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException) HumanTaskRuntimeException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)

Example 20 with IllegalAccessFault

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);
    }
}
Also used : Element(org.w3c.dom.Element) HumanTaskIllegalArgumentException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException) RegistryException(org.wso2.carbon.registry.core.exceptions.RegistryException) HumanTaskIllegalStateException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException) HumanTaskIllegalOperationException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException) UserStoreException(org.wso2.carbon.user.core.UserStoreException) HumanTaskException(org.wso2.carbon.humantask.core.engine.HumanTaskException) HumanTaskIllegalAccessException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException) HumanTaskRuntimeException(org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException) Fail(org.wso2.carbon.humantask.core.engine.commands.Fail)

Aggregations

HumanTaskException (org.wso2.carbon.humantask.core.engine.HumanTaskException)23 HumanTaskIllegalAccessException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException)23 HumanTaskIllegalArgumentException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException)23 HumanTaskIllegalOperationException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException)23 HumanTaskIllegalStateException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException)23 HumanTaskRuntimeException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)23 RegistryException (org.wso2.carbon.registry.core.exceptions.RegistryException)23 UserStoreException (org.wso2.carbon.user.core.UserStoreException)23 Element (org.w3c.dom.Element)8 HumanTaskCommand (org.wso2.carbon.humantask.core.engine.HumanTaskCommand)5 HumanTaskEngine (org.wso2.carbon.humantask.core.engine.HumanTaskEngine)4 HumanTaskDAOConnection (org.wso2.carbon.humantask.core.dao.HumanTaskDAOConnection)3 TaskDAO (org.wso2.carbon.humantask.core.dao.TaskDAO)3 QName (javax.xml.namespace.QName)2 URI (org.apache.axis2.databinding.types.URI)2 NodeList (org.w3c.dom.NodeList)2 IllegalAccessFault (org.wso2.carbon.humantask.client.api.IllegalAccessFault)2 Complete (org.wso2.carbon.humantask.core.engine.commands.Complete)2 Start (org.wso2.carbon.humantask.core.engine.commands.Start)2 Callable (java.util.concurrent.Callable)1