Package org.jbpm.api

Examples of org.jbpm.api.ProcessDefinition


  public void pic() throws IOException {
    init();
    ProcessInstance processInstance = executionService
        .findProcessInstanceById(id);
    String processDefinitionId = processInstance.getProcessDefinitionId();
    ProcessDefinition processDefinition = repositoryService
        .createProcessDefinitionQuery()
        .processDefinitionId(processDefinitionId).uniqueResult();
    ServletContext context = ServletActionContext.getServletContext();
    Date date = new Date();
    String filePath = context.getRealPath("/") + "/jbpm/jbpm"
View Full Code Here


    public void tearDown() {
    }
   
    @Test
    public void simpleProcessExecution() {
        ProcessDefinition process = new ProcessDefinitionImpl();
        StartEventNode startEvent = new StartEventNode();
        process.addNode(0L, startEvent);
        ActionNode actionNode = new ActionNode(new Action() {

            @Override
            public void execute() {
                System.out.println("Executing the Action!!");
            }
        });
        process.addNode(1L, actionNode);
        EndEventNode endEvent = new EndEventNode();
        process.addNode(2L, endEvent);
       
        startEvent.addOutgoingFlow(SequenceFlow.FLOW_DEFAULT_TYPE, new SequenceFlowImpl(SequenceFlow.FLOW_DEFAULT_TYPE, actionNode));
        actionNode.addOutgoingFlow(SequenceFlow.FLOW_DEFAULT_TYPE, new SequenceFlowImpl(SequenceFlow.FLOW_DEFAULT_TYPE, endEvent));
       
        ProcessInstance processInstance = ProcessInstanceFactory.newProcessInstance(process);
View Full Code Here

      if (log.isTraceEnabled()) log.trace("created id '"+id+"' for "+processDefinition);
      processDefinition.setId(id);
    }
   
    RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
    ProcessDefinition existingProcessDefinition = repositorySession.createProcessDefinitionQuery()
        .processDefinitionId(id)
        .uniqueResult();
    if (existingProcessDefinition != null) {
      deployment.addProblem("process '" + id + "' already exists");
    }
View Full Code Here

    int version = processDefinition.getVersion();
    String key = processDefinition.getKey();
    if (version==ProcessDefinitionImpl.UNASSIGNED_VERSION) {
      RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
     
      ProcessDefinition latestDeployedVersion = repositorySession
          .createProcessDefinitionQuery()
          .processDefinitionKey(key)
          .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
          .page(0, 1)
          .uniqueResult();

      if (latestDeployedVersion!=null) {
        version = latestDeployedVersion.getVersion() + 1;
      } else {
        version = 1;
      }
      if (log.isTraceEnabled()) log.trace("assigning version "+version+" to process definition "+key);
      processDefinition.setVersion(version);
View Full Code Here

  public ProcessDefinitionQueryImpl createProcessDefinitionQuery() {
    return new ProcessDefinitionQueryImpl();
  }

  public ProcessDefinitionImpl findProcessDefinitionByKey(String processDefinitionKey) {
    ProcessDefinition processDefinition = createProcessDefinitionQuery()
      .processDefinitionKey(processDefinitionKey)
      .orderDesc(ProcessDefinitionQuery.PROPERTY_VERSION)
      .page(0, 1)
      .uniqueResult();

    if (processDefinition!=null) {
      return findProcessDefinitionById(processDefinition.getId());
    } else {
      validateRepositoryCache();
    }

    return null;
View Full Code Here

      if (processInstanceIds.size()>0) {
        throw new JbpmException("still "+processInstanceIds.size()+" process instances for process definition "+processDefinitionId);
      }
    }
   
    ProcessDefinition processDefinition = findProcessDefinitionById(processDefinitionId);
    session.delete(processDefinition);
  }
View Full Code Here

TOP

Related Classes of org.jbpm.api.ProcessDefinition

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.