Package org.jbpm.api

Examples of org.jbpm.api.JbpmException


  protected ClientExecution getExecution(Environment environment, String executionId) {
    DbSession dbSession = environment.get(DbSession.class);
    ClientExecution execution = dbSession.findExecutionById(executionId);
    if (execution == null) {
      throw new JbpmException("execution " + executionId + " doesn't exist");
    }
    return execution;
  }
View Full Code Here


    return lifeCycleExecution.getActivity().getName();
  }

  public static ProcessDefinitionImpl getLifeCycle(TaskImpl task) {
    if (task==null) {
      throw new JbpmException("task is null");
    }
    String resource = task.getLifeCycleResource();
    if (resource==null) {
      throw new JbpmException("task "+task.getClass().getName()+" did'nt return a lifecycle");
    }
    ProcessDefinitionImpl lifeCycleProcess;
    synchronized (lifeCycleProcesses) {
      lifeCycleProcess = lifeCycleProcesses.get(resource);
      if (lifeCycleProcess==null) {
View Full Code Here

  public void init() throws ServletException {
    String configurationResource = getInitParameter("jbpm.configuration.resource", "jbpm.cfg.xml");
    EnvironmentFactory environmentFactory = (EnvironmentFactory) new Configuration().setResource(configurationResource).buildProcessEngine();
    jobExecutor = environmentFactory.get(JobExecutor.class);
    if (jobExecutor==null) {
      throw new JbpmException("no job executor configured in resource "+configurationResource);
    }
    jobExecutor.start();
  }
View Full Code Here

    return this;
  }

  public HistoryActivityInstanceQuery processDefinitionId(String processDefinitionId) {
    if (processDefinitionId==null) {
      throw new JbpmException("processInstanceId is null");
    }
    this.processDefinitionId = processDefinitionId;
    return this;
  }
View Full Code Here

  String processDefinitionId;
  String activityName;
 
  public GetStartFormResourceNameCmd(String processDefinitionId, String activityName) {
    if (processDefinitionId==null) {
      throw new JbpmException("processDefinitionId is null");
    }
    this.processDefinitionId = processDefinitionId;
    this.activityName = activityName;
  }
View Full Code Here

  /* groupIds transports the groupIds from the hql to the applyParameters */
  protected List<String> groupIds;

  public TaskQuery assignee(String assignee) {
    if (candidate!=null) {
      throw new JbpmException("assignee(...) cannot be combined with candidate(...) in one query");
    }
    this.assignee = assignee;
    return this;
  }
View Full Code Here

  public Object evaluate(String script, String language) {
    if (script==null) {
      return null;
    }
    if (language==null) {
      throw new JbpmException("no language specified");
    }
    ScriptEngine scriptEngine = scriptEngineManager.getEngineByName(language);
    if (scriptEngine==null) {
      throw new JbpmException("no scripting engine configured for language "+language);
    }
   
    if (log.isTraceEnabled()) log.trace("evaluating "+language+" script "+script);
   
    return evaluate(scriptEngine, script);
View Full Code Here

    try {
      Object result = scriptEngine.eval(script);
      if (log.isTraceEnabled()) log.trace("script evaluated to "+result);
      return result;
    } catch (ScriptException e) {
      throw new JbpmException("script evaluation error: "+e.getMessage(), e);
    }
  }
View Full Code Here

  }

  public void setValue(Object value) {
    if (converter!=null) {
      if (! converter.supports(value)) {
        throw new JbpmException("the converter '"+converter.getClass().getName()+"' in variable instance '"+this.getClass().getName()+"' does not support values of type '"+value.getClass().getName()+"'.  to change the type of a variable, you have to delete it first");
      }
      value = converter.convert(value);
    }
    if ( (value!=null)
         && (! this.isStorable(value)) ) {
      throw new JbpmException("variable instance '"+this.getClass().getName()+"' does not support values of type '"+value.getClass().getName()+"'.  to change the type of a variable, you have to delete it first");
    }
    setObject(value);
   
    HistorySession historySession = Environment.getFromCurrent(HistorySession.class, false);
    if ( isHistoryEnabled
View Full Code Here

  }

  public Void execute(Environment environment) {
    DbSession dbSession = Environment.getFromCurrent(DbSession.class);
    if (dbSession==null) {
      throw new JbpmException("no "+DbSessionBinding.TAG+" configured");
    }
    dbSession.deleteProcessDefinition(processDefinitionId, deleteProcessInstances, deleteHistory);
    return null;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.api.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.