Package org.activiti.engine

Examples of org.activiti.engine.ActivitiIllegalArgumentException


    return eventSubscription("message", messageName);
  }
 
  public ExecutionQuery eventSubscription(String eventType, String eventName) {
    if(eventName == null) {
      throw new ActivitiIllegalArgumentException("event name is null");
    }
    if(eventType == null) {
      throw new ActivitiIllegalArgumentException("event type is null");
    }
    if(eventSubscriptions == null) {
      eventSubscriptions = new ArrayList<EventSubscriptionQueryValue>();
    }
    eventSubscriptions.add(new EventSubscriptionQueryValue(eventName, eventType));
View Full Code Here


    this.clockReader = clockReader;
    List<String> expression = Arrays.asList(expressionS.split("/"));
    datatypeFactory = DatatypeFactory.newInstance();

    if (expression.size() > 3 || expression.isEmpty()) {
      throw new ActivitiIllegalArgumentException("Cannot parse duration");
    }
    if (expression.get(0).startsWith("R")) {
      isRepeat = true;
      times = expression.get(0).length() == 1 ? Integer.MAX_VALUE : Integer.parseInt(expression.get(0).substring(1));
      expression = expression.subList(1, expression.size());
View Full Code Here

      result = new ErrorThrowingEventListener();
      ((ErrorThrowingEventListener) result).setErrorCode(eventListener.getImplementation());
    }

    if (result == null) {
      throw new ActivitiIllegalArgumentException("Cannot create an event-throwing event-listener, unknown implementation type: "
              + eventListener.getImplementationType());
    }

    result.setEntityClass(getEntityType(eventListener.getEntityType()));
    return result;
View Full Code Here

   */
  protected Class<?> getEntityType(String entityType) {
    if(entityType != null) {
      Class<?> entityClass = ENTITY_MAPPING.get(entityType.trim());
      if(entityClass == null) {
        throw new ActivitiIllegalArgumentException("Unsupported entity-type for an ActivitiEventListener: " + entityType);
      }
      return entityClass;
    }
    return null;
  }
View Full Code Here

  @Override
  public void onEvent(ActivitiEvent event) {
    if (isValidEvent(event)) {

      if (event.getProcessInstanceId() == null && processInstanceScope) {
        throw new ActivitiIllegalArgumentException(
            "Cannot throw process-instance scoped signal, since the dispatched event is not part of an ongoing process instance");
      }

      CommandContext commandContext = Context.getCommandContext();
      List<SignalEventSubscriptionEntity> subscriptionEntities = null;
View Full Code Here

        throw new ActivitiException("Exception while invoking '" + declaration.getName() + "' on class " + target.getClass().getName(), e);
      }
    } else {
      Field field = ReflectUtil.getField(declaration.getName(), target);
      if(field == null) {
        throw new ActivitiIllegalArgumentException("Field definition uses unexisting field '" + declaration.getName() + "' on class " + target.getClass().getName());
      }
      // Check if the delegate field's type is correct
     if(!fieldTypeCompatible(declaration, field)) {
       throw new ActivitiIllegalArgumentException("Incompatible type set on field declaration '" + declaration.getName()
          + "' for class " + target.getClass().getName()
          + ". Declared value has type " + declaration.getValue().getClass().getName()
          + ", while expecting " + field.getType().getName());
     }
     ReflectUtil.setField(field, target, declaration.getValue());
View Full Code Here

      } else {
       
        // Force failing, since the exception we're about to throw cannot be ignored, because it
        // did not originate from the listener itself
        failOnException = true;
        throw new ActivitiIllegalArgumentException("Delegate expression " + expression
            + " did not resolve to an implementation of " + ActivitiEventListener.class.getName());
      }
    }
  }
View Full Code Here

    if(eventType.equals("message")) {
      eventSubscriptionEntity = new MessageEventSubscriptionEntity(execution);
    }else  if(eventType.equals("signal")) {
      eventSubscriptionEntity = new SignalEventSubscriptionEntity(execution);
    }else {
      throw new ActivitiIllegalArgumentException("Found event definition of unknown type: "+eventType);
    }
   
    eventSubscriptionEntity.setEventName(eventName);
    if(activityId != null) {
      ActivityImpl activity = execution.getProcessDefinition().findActivity(activityId);
View Full Code Here

    if (delegateInstance instanceof ExecutionListener) {
      return (ExecutionListener) delegateInstance;
    } else if (delegateInstance instanceof JavaDelegate) {
      return new ServiceTaskJavaDelegateActivityBehavior((JavaDelegate) delegateInstance);
    } else {
      throw new ActivitiIllegalArgumentException(delegateInstance.getClass().getName()+" doesn't implement "+ExecutionListener.class+" nor "+JavaDelegate.class);
    }
  }
View Full Code Here

  protected TaskListener getTaskListenerInstance() {
    Object delegateInstance = instantiateDelegate(className, fieldDeclarations);
    if (delegateInstance instanceof TaskListener) {
      return (TaskListener) delegateInstance;
    } else {
      throw new ActivitiIllegalArgumentException(delegateInstance.getClass().getName()+" doesn't implement "+TaskListener.class);
    }
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.ActivitiIllegalArgumentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.