Package org.activiti.engine

Examples of org.activiti.engine.RepositoryService


 
  public void startProcessWithJob() throws Exception {
    ProcessEngineConfiguration createStandaloneInMemProcessEngineConfiguration = StandaloneInMemProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
    createStandaloneInMemProcessEngineConfiguration.setJobExecutorActivate(true);
    ProcessEngine processEngine = createStandaloneInMemProcessEngineConfiguration.buildProcessEngine();
    RepositoryService repositoryService = processEngine.getRepositoryService();
    repositoryService.createDeployment().addInputStream("TimeBoundaryIntermediateEvent.bpmn20.xml",
        new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("name", "Activiti");
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("TimeBoundaryIntermediateEvent", variableMap);
View Full Code Here


  @Test
  public void startProcess() throws Exception {
    TaskService taskService = activitiRule.getTaskService();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    RepositoryService repositoryService = activitiRule.getRepositoryService();

    // 部署两个流程
    repositoryService.createDeployment().addInputStream("master.bpmn20.xml", new FileInputStream(filename)).deploy();
    repositoryService.createDeployment().addInputStream("business.bpmn20.xml", new FileInputStream(filename1)).deploy();

    // 准备变量
    Map<String, Object> variableMap = new HashMap<String, Object>();
    List<String> users = new ArrayList<String>();
    users.add("user1");
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule.getRepositoryService();
    repositoryService.createDeployment().addInputStream("multiSubProcess1.bpmn20.xml",
        new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("name", "Activiti");
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("multiSubProcess1", variableMap);
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule
        .getRepositoryService();
    repositoryService
        .createDeployment()
        .addInputStream("EventGateway.bpmn20.xml",
            new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule.getRepositoryService();
    repositoryService.createDeployment().addInputStream("ErrorBoundaryEventAttachToTask.bpmn20.xml",
        new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("name", "Activiti");
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("ErrorBoundaryEventAttachToTask", variableMap);
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule.getRepositoryService();
    repositoryService.createDeployment().addInputStream("DefaultFlow.bpmn20.xml", new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("type", "2");
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("DefaultFlow", variableMap);
    assertNotNull(processInstance.getId());
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule
        .getRepositoryService();
    repositoryService
        .createDeployment()
        .addInputStream("drools.bpmn20.xml",
            new FileInputStream(filename))
        .addInputStream("hello.drl", new FileInputStream(ruleFile))
        .deploy();
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule.getRepositoryService();
    TaskService taskService = activitiRule.getTaskService();
    repositoryService.createDeployment().addInputStream("process1.bpmn20.xml", new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("name", "Activiti");
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("MyProcess", variableMap);
    assertNotNull(processInstance.getId());
View Full Code Here

    if (processDefinitionId == null) {
      throw new ActivitiException("No process definition id provided");
    }

    RepositoryService repositoryService = ActivitiUtil.getRepositoryService();
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
        .processDefinitionId(processDefinitionId).singleResult();

    if (processDefinition == null) {
      throw new ActivitiException("Process definition " + processDefinitionId + " could not be found");
    }

    if (processDefinition.getDiagramResourceName() == null) {
      throw new ActivitiException("Diagram resource could not be found");
    }
    final InputStream definitionImageStream = repositoryService.getResourceAsStream(
        processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName());

    if (definitionImageStream == null) {
      throw new ActivitiException("Diagram resource could not be found");
    }
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule.getRepositoryService();
    TaskService taskService = activitiRule.getTaskService();
    repositoryService.createDeployment().addInputStream("process1.bpmn20.xml", new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    ProcessInstance processInstance = null;
    try {
      processInstance = runtimeService.startProcessInstanceByKey("process1", variableMap);
View Full Code Here

TOP

Related Classes of org.activiti.engine.RepositoryService

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.