Search in sources :

Example 1 with ActivitiIllegalArgumentException

use of org.activiti.engine.ActivitiIllegalArgumentException in project Activiti by Activiti.

the class DelegateExpressionTaskListener method notify.

public void notify(DelegateTask delegateTask) {
    // Note: we can't cache the result of the expression, because the
    // execution can change: eg. delegateExpression='${mySpringBeanFactory.randomSpringBean()}'
    Object delegate = expression.getValue(delegateTask.getExecution());
    ClassDelegate.applyFieldDeclaration(fieldDeclarations, delegate);
    if (delegate instanceof TaskListener) {
        try {
            Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new TaskListenerInvocation((TaskListener) delegate, delegateTask));
        } catch (Exception e) {
            throw new ActivitiException("Exception while invoking TaskListener: " + e.getMessage(), e);
        }
    } else {
        throw new ActivitiIllegalArgumentException("Delegate expression " + expression + " did not resolve to an implementation of " + TaskListener.class);
    }
}
Also used : ActivitiException(org.activiti.engine.ActivitiException) TaskListenerInvocation(org.activiti.engine.impl.delegate.TaskListenerInvocation) ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) TaskListener(org.activiti.engine.delegate.TaskListener) ActivitiException(org.activiti.engine.ActivitiException) ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException)

Example 2 with ActivitiIllegalArgumentException

use of org.activiti.engine.ActivitiIllegalArgumentException in project Activiti by Activiti.

the class UserQueryTest method testQueryByInvalidEmailLike.

public void testQueryByInvalidEmailLike() {
    UserQuery query = identityService.createUserQuery().userEmailLike("%invalid%");
    verifyQueryResults(query, 0);
    try {
        identityService.createUserQuery().userEmailLike(null).singleResult();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) UserQuery(org.activiti.engine.identity.UserQuery)

Example 3 with ActivitiIllegalArgumentException

use of org.activiti.engine.ActivitiIllegalArgumentException in project Activiti by Activiti.

the class GroupQueryTest method testQueryByInvalidName.

public void testQueryByInvalidName() {
    GroupQuery query = identityService.createGroupQuery().groupName("invalid");
    verifyQueryResults(query, 0);
    try {
        identityService.createGroupQuery().groupName(null).list();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) GroupQuery(org.activiti.engine.identity.GroupQuery)

Example 4 with ActivitiIllegalArgumentException

use of org.activiti.engine.ActivitiIllegalArgumentException in project Activiti by Activiti.

the class GroupQueryTest method testQueryByInvalidId.

public void testQueryByInvalidId() {
    GroupQuery query = identityService.createGroupQuery().groupId("invalid");
    verifyQueryResults(query, 0);
    try {
        identityService.createGroupQuery().groupId(null).list();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) GroupQuery(org.activiti.engine.identity.GroupQuery)

Example 5 with ActivitiIllegalArgumentException

use of org.activiti.engine.ActivitiIllegalArgumentException in project Activiti by Activiti.

the class UserQueryTest method testQueryByInvalidFirstNameLike.

public void testQueryByInvalidFirstNameLike() {
    UserQuery query = identityService.createUserQuery().userFirstNameLike("%mispiggy%");
    verifyQueryResults(query, 0);
    try {
        identityService.createUserQuery().userFirstNameLike(null).singleResult();
        fail();
    } catch (ActivitiIllegalArgumentException e) {
    }
}
Also used : ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) UserQuery(org.activiti.engine.identity.UserQuery)

Aggregations

ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)180 ActivitiObjectNotFoundException (org.activiti.engine.ActivitiObjectNotFoundException)47 ActivitiException (org.activiti.engine.ActivitiException)43 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)27 RestResponseFactory (org.wso2.carbon.bpmn.rest.common.RestResponseFactory)23 ExecutionEntity (org.activiti.engine.impl.persistence.entity.ExecutionEntity)19 RestVariable (org.wso2.carbon.bpmn.rest.engine.variable.RestVariable)15 ArrayList (java.util.ArrayList)13 HashMap (java.util.HashMap)12 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)12 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)11 VariableInstance (org.activiti.engine.impl.persistence.entity.VariableInstance)10 MultipartHttpServletRequest (org.springframework.web.multipart.MultipartHttpServletRequest)10 Path (javax.ws.rs.Path)9 TaskEntity (org.activiti.engine.impl.persistence.entity.TaskEntity)9 RestVariable (org.activiti.rest.service.api.engine.variable.RestVariable)9 QueryVariable (org.wso2.carbon.bpmn.rest.engine.variable.QueryVariable)9 IOException (java.io.IOException)8 Date (java.util.Date)8 Produces (javax.ws.rs.Produces)8