Search in sources :

Example 16 with IllegalArgumentFault

use of org.wso2.carbon.humantask.client.api.IllegalArgumentFault in project carbon-business-process by wso2.

the class TaskOperationsImpl method stop.

/**
 * Cancel/stop the processing of the task. The task returns to the Reserved state.
 *
 * @param taskId : task identifier
 * @throws IllegalStateFault
 * @throws IllegalOperationFault
 * @throws IllegalArgumentFault
 * @throws IllegalAccessFault
 */
public void stop(final URI taskId) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
    try {
        validateTaskId(taskId);
        HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {

            public Object call() throws Exception {
                HumanTaskCommand stop = new Stop(getCaller(), new Long(taskId.toString()));
                stop.execute();
                return null;
            }
        });
    } catch (Exception ex) {
        handleException(ex);
    }
}
Also used : Stop(org.wso2.carbon.humantask.core.engine.commands.Stop) HumanTaskCommand(org.wso2.carbon.humantask.core.engine.HumanTaskCommand) 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 IllegalArgumentFault

use of org.wso2.carbon.humantask.client.api.IllegalArgumentFault 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 18 with IllegalArgumentFault

use of org.wso2.carbon.humantask.client.api.IllegalArgumentFault 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 19 with IllegalArgumentFault

use of org.wso2.carbon.humantask.client.api.IllegalArgumentFault 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 20 with IllegalArgumentFault

use of org.wso2.carbon.humantask.client.api.IllegalArgumentFault 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)

Aggregations

HumanTaskIllegalAccessException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalAccessException)25 HumanTaskException (org.wso2.carbon.humantask.core.engine.HumanTaskException)24 HumanTaskIllegalArgumentException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalArgumentException)24 HumanTaskIllegalOperationException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalOperationException)24 HumanTaskIllegalStateException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskIllegalStateException)24 HumanTaskRuntimeException (org.wso2.carbon.humantask.core.engine.runtime.api.HumanTaskRuntimeException)24 RegistryException (org.wso2.carbon.registry.core.exceptions.RegistryException)24 UserStoreException (org.wso2.carbon.user.core.UserStoreException)24 Element (org.w3c.dom.Element)9 TaskDAO (org.wso2.carbon.humantask.core.dao.TaskDAO)5 HumanTaskCommand (org.wso2.carbon.humantask.core.engine.HumanTaskCommand)5 QName (javax.xml.namespace.QName)4 HumanTaskDAOConnection (org.wso2.carbon.humantask.core.dao.HumanTaskDAOConnection)4 HumanTaskEngine (org.wso2.carbon.humantask.core.engine.HumanTaskEngine)4 HumanTaskBaseConfiguration (org.wso2.carbon.humantask.core.store.HumanTaskBaseConfiguration)3 URI (org.apache.axis2.databinding.types.URI)2 NodeList (org.w3c.dom.NodeList)2 IllegalArgumentFault (org.wso2.carbon.humantask.client.api.IllegalArgumentFault)2 Complete (org.wso2.carbon.humantask.core.engine.commands.Complete)2 IOException (java.io.IOException)1