Package org.jbpm

Examples of org.jbpm.JbpmException


          {
            baseDate = ((Calendar)result).getTime();
          }
          else
          {
            throw new JbpmException("Invalid basedate type: " + baseDateEL + " is of type " + result.getClass().getName()
                + ". Only Date and Calendar are supported");
          }
          int endOfELIndex = dueDateString.indexOf("}");
          if (endOfELIndex < (dueDateString.length() - 1))
          {
            char durationSeparator = dueDateString.substring(endOfELIndex + 1).trim().charAt(0);
            if (durationSeparator != '+' && durationSeparator != '-')
            {
              throw new JbpmException("Invalid duedate, + or - missing after EL");
            }
            durationString = dueDateString.substring(endOfELIndex + 1).trim();
          }
        }
        else
View Full Code Here


    }

    if (destination == null)
    {
      String transitionName = (name != null ? "'" + name + "'" : "in node '" + from + "'");
      throw new JbpmException("transition " + transitionName + " doesn't have destination. check your processdefinition.xml");
    }

    // performance optimisation: check if at least there is a candidate superstate to be entered.
    if (destination.getSuperState() != null)
    {
View Full Code Here

  void performAssignmentActorIdExpr(String actorIdExpression, Assignable assignable, ExecutionContext executionContext)
  {
    Object result = JbpmExpressionEvaluator.evaluate(actorIdExpression, executionContext);
    if (result == null)
    {
      throw new JbpmException("actor-id expression '" + actorIdExpression + "' returned null");
    }
    if (!(result instanceof String))
    {
      throw new JbpmException("actor-id expression '" + actorIdExpression + "' didn't resolve to a java.lang.String: '" + result + "' ("
          + result.getClass().getName() + ")");       
    }
    assignable.setActorId((String) result);
  }
View Full Code Here

  {
    String[] pooledActors = null;
    Object result = JbpmExpressionEvaluator.evaluate(pooledActorsExpression, executionContext);
    if (result == null)
    {
      throw new JbpmException("pooled-actors expression '" + pooledActorsExpression + "' returned null");
    }

    if (result instanceof String[])
    {
      pooledActors = (String[])result;
    }
    else if (result instanceof Collection)
    {
      Collection<?> collection = (Collection<?>)result;
      pooledActors = collection.toArray(new String[collection.size()]);
    }
    else if (result instanceof String)
    {
      List<String> pooledActorList = new ArrayList<String>();
      StringTokenizer tokenizer = new StringTokenizer((String)result, ",");
      while (tokenizer.hasMoreTokens())
      {
        pooledActorList.add(tokenizer.nextToken().trim());
      }
      pooledActors = pooledActorList.toArray(new String[pooledActorList.size()]);
    }
    else
    {
      throw new JbpmException("pooled-actors expression '" + pooledActorsExpression + "' didn't resolve to a comma separated String, a Collection or a String[]: '"
          + result + "' (" + result.getClass().getName() + ")");
    }

    assignable.setPooledActors(pooledActors);
  }
View Full Code Here

  TaskInstance instantiateNewTaskInstance(ExecutionContext executionContext)
  {
    TaskInstanceFactory taskInstanceFactory = (TaskInstanceFactory)JbpmConfiguration.Configs.getObject("jbpm.task.instance.factory");
    if (taskInstanceFactory == null)
    {
      throw new JbpmException("jbpm.task.instance.factory was not configured in jbpm.cfg.xml");
    }
    return taskInstanceFactory.createTaskInstance(executionContext);
  }
View Full Code Here

    Swimlane swimlane = (taskMgmtDefinition != null ? taskMgmtDefinition.getSwimlane(swimlaneName) : null);
    if (swimlane != null)
    {
      return createSwimlaneInstance(swimlane);
    }
    throw new JbpmException("couldn't create swimlane instance for non-existing swimlane " + swimlaneName);
  }
View Full Code Here

   */
  public void suspend(Token token)
  {
    if (token == null)
    {
      throw new JbpmException("can't suspend task instances for token null");
    }
    if (taskInstances != null)
    {
      Iterator<TaskInstance> iter = taskInstances.iterator();
      while (iter.hasNext())
View Full Code Here

   */
  public void resume(Token token)
  {
    if (token == null)
    {
      throw new JbpmException("can't suspend task instances for token null");
    }
    if (taskInstances != null)
    {
      Iterator<TaskInstance> iter = taskInstances.iterator();
      while (iter.hasNext())
View Full Code Here

        // the variable is unpersistable... booom!
        String name = entry.getKey();
        Object value = variableInstance.getValue();
        if (value != null) {
          throw new JbpmException("variable '"
              + name
              + "' in "
              + variableContainer
              + " contains value '"
              + value
              + "': type '"
              + value.getClass().getName()
              + "' is not mapped in jbpm.varmapping.xml");
        }
        else {
          throw new JbpmException("variable '"
              + name
              + "' in '"
              + variableContainer
              + "' was created with a non persistable value");
        }
View Full Code Here

      String dollarExpression = translateExpressionToDollars(expression);
      result = evaluator.evaluate(dollarExpression, Object.class, usedVariableResolver, functionMapper);

    } catch (ELException e) {
     
      throw new JbpmException("couldn't evaluate expression '"+expression+"'", (e.getRootCause()!=null ? e.getRootCause() : e));
    } finally {
      ExecutionContext.popCurrentContext(executionContext);
    }
   
    return result;
View Full Code Here

TOP

Related Classes of org.jbpm.JbpmException

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.