Package org.activiti.engine.repository

Examples of org.activiti.engine.repository.ProcessDefinition


        String wfn = wff+"20.xml"; // TODO 9: workaround for http://forums.activiti.org/en/viewtopic.php?f=8&t=3745&start=10
        DeploymentBuilder db = repoSvc.createDeployment().addInputStream(wfn,new FileInputStream(wff));

        // TODO 4: We should avoid redeploying here, if workflow file of a given version(?) is already deployed?
        Deployment d = db.deploy();
        ProcessDefinition pDef = repoSvc.createProcessDefinitionQuery().deploymentId(d.getId()).singleResult();
        LOGGER.fine("deployedToEngine("+wff+") --> "+pDef);
    }
View Full Code Here


            LOGGER.fine("deployed process definitions:");
            for (ProcessDefinition pDef : repoSvc.createProcessDefinitionQuery().latestVersion().list()){
                LOGGER.fine("  pDef:"+pDef+" id="+pDef.getId()+" key="+pDef.getKey()+" name="+pDef.getName()+" resourceName="+pDef.getResourceName()+" version="+pDef.getVersion());
            }
        }
        ProcessDefinition pDef = repoSvc
                                 .createProcessDefinitionQuery()
                                 .processDefinitionKey(wfName)
                                 .latestVersion()
                                 .singleResult();
        LOGGER.fine("getDeployedWf("+quoted(wfName)+") --> "+pDef);
View Full Code Here

        LOGGER.fine("getDeployedWf("+quoted(wfName)+") --> "+pDef);
        return pDef;
    }
   
    static void generateWfDiagramTo(String wfName, OutputStream out) throws IOException{
        ProcessDefinition pDef = getDeployedWf(wfName);
        InputStream in = JenkowEngine.getEngine().getRepositoryService().getResourceAsStream(pDef.getDeploymentId(),pDef.getDiagramResourceName());
        // TODO kk? should use copyStreamAndClose here?
        Util.copyStream(in,out);
    }
View Full Code Here

    Annotation[] qualifiers = getQualifiers(event);          
    getBeanManager().fireEvent(event, qualifiers);   
  }

  protected BusinessProcessEvent createEvent(DelegateExecution execution) {
    ProcessDefinition processDefinition = Context.getExecutionContext().getProcessDefinition();
    return new CdiBusinessProcessEvent(activityId, transitionName, processDefinition, execution, type, execution.getProcessInstanceId(), execution.getId(), new Date());
  }
View Full Code Here

    Annotation[] qualifiers = getQualifiers(event);          
    getBeanManager().fireEvent(event, qualifiers);   
  }

  protected BusinessProcessEvent createEvent(DelegateTask task) {
    ProcessDefinition processDefinition = Context.getProcessEngineConfiguration().getProcessDefinitionCache().get(task.getExecution().getProcessDefinitionId());
    return new CdiBusinessProcessEvent(activityId, transitionName, processDefinition, task, type, task.getExecution().getProcessInstanceId(), task.getExecutionId(), new Date());
  }
View Full Code Here

                                                            finished().
                                                            includeProcessVariables().
                                                            singleResult();
    assertNotNull(historicProcessInstance);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().
                                                processDefinitionId(historicProcessInstance.getProcessDefinitionId()).
                                                singleResult();
    assertEquals(SIMPLEST_PROCESS, processDefinition.getKey());

    assertEquals(1, historicProcessInstance.getProcessVariables().size());
    assertEquals(TEST_VALUE, historicProcessInstance.getProcessVariables().get(TEST_VARIABLE));
    assertEquals(BUSINESS_KEY, historicProcessInstance.getBusinessKey());
  }
View Full Code Here

   
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot use startProcessByName in an activiti command.");
    }
   
    ProcessDefinition definition = processEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionName(string).singleResult();
    if (definition == null) {
      throw new ActivitiObjectNotFoundException("No process definition found for name: " + string, ProcessDefinition.class);
    }
    ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceById(definition.getId(), getAndClearCachedVariables());
    if(!instance.isEnded()) {
      setExecution(instance);
    }
    return instance;
  }
View Full Code Here

   
    if(Context.getCommandContext() != null) {
      throw new ActivitiCdiException("Cannot use startProcessByName in an activiti command.");
    }
   
    ProcessDefinition definition = processEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionName(string).singleResult();
    if (definition == null) {
      throw new ActivitiObjectNotFoundException("No process definition found for name: " + string, ProcessDefinition.class);
    }
    Map<String, Object> cachedVariables = getAndClearCachedVariables();
    cachedVariables.putAll(variables);
    ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceById(definition.getId(), cachedVariables);
    if(!instance.isEnded()) {
      setExecution(instance);
    }
    return instance;
  }
View Full Code Here

      finished().
      includeProcessVariables().
      singleResult();
    assertNotNull(historicProcessInstance);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    final ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().
      processDefinitionId(historicProcessInstance.getProcessDefinitionId()).
      singleResult();
    assertEquals(SIMPLEST_PROCESS, processDefinition.getKey());

    assertEquals(1, historicProcessInstance.getProcessVariables().size());
    assertEquals(TEST_VALUE, historicProcessInstance.getProcessVariables().get(TEST_VARIABLE));
    assertEquals(BUSINESS_KEY, historicProcessInstance.getBusinessKey());
  }
View Full Code Here

                  .addString(processName, new String(bpmnBytes))
                  .deploy();
         
          // Generate reports
          if (deployModelPopupWindow.isGenerateReports()) {
            ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
                    .deploymentId(deployment.getId()).singleResult();
            ReportingUtil.generateTaskDurationReport(processDefinition.getId());
          }

          // Close popup and show new deployment
          deployModelPopupWindow.closePopupWindow();
          ExplorerApp.get().getViewManager().showDeploymentPage(deployment.getId());
View Full Code Here

TOP

Related Classes of org.activiti.engine.repository.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.