Package org.activiti.engine

Examples of org.activiti.engine.RepositoryService


            
            WorkflowDefinitionConversion conversion = ExplorerApp.get()
                    .getWorkflowDefinitionConversionFactory().createWorkflowDefinitionConversion(workflowDefinition);
            conversion.convert();
           
            RepositoryService repositoryService = ProcessEngines.getDefaultProcessEngine().getRepositoryService();
            model.setCategory(null);
           
            ObjectMapper objectMapper = new ObjectMapper();
            ObjectNode metaInfoJson = objectMapper.createObjectNode();
            metaInfoJson.put("name", model.getName());
            model.setMetaInfo(metaInfoJson.toString());
            repositoryService.saveModel(model);
           
            BpmnJsonConverter bpmnJsonConverter = new BpmnJsonConverter();
            ObjectNode json = bpmnJsonConverter.convertToJson(conversion.getBpmnModel());
            repositoryService.addModelEditorSource(model.getId(), json.toString().getBytes("utf-8"));
           
            // Show modeler
            showModeler();
           
          } else {
View Full Code Here


              .setJobExecutorActivate(true)
              .buildProcessEngine();
   
    System.out.println("engine version: "+eng.VERSION);
   
    RepositoryService repoSvc = eng.getRepositoryService();
    RuntimeService rtSvc = eng.getRuntimeService();
   
    String wfn = "/diagrams/Wf.bpmn";
    String wffn = wfn+"20.xml"; // workaround for http://forums.activiti.org/en/viewtopic.php?f=8&t=3745&start=10
        DeploymentBuilder db = repoSvc
                 .createDeployment()
                 .addInputStream(wffn,this.getClass().getResourceAsStream(wfn));
   
        Deployment d = db.deploy();
        ProcessDefinition pDef = repoSvc
                                 .createProcessDefinitionQuery()
                                 .deploymentId(d.getId())
                                 .singleResult();

        Map<String,Object> varMap = new HashMap<String,Object>();
View Full Code Here

                            .createStandaloneInMemProcessEngineConfiguration()
                            .buildProcessEngine();
       
        System.out.println("engine version: "+eng.VERSION);
       
        RepositoryService repoSvc = eng.getRepositoryService();
        RuntimeService rtSvc = eng.getRuntimeService();
       
        String wfn = "/diagrams/GenDiag.bpmn";
        String wffn = wfn+"20.xml"; // workaround for http://forums.activiti.org/en/viewtopic.php?f=8&t=3745&start=10
        DeploymentBuilder db = repoSvc
                               .createDeployment()
                               .addInputStream(wffn,this.getClass().getResourceAsStream(wfn));
       
        Deployment d = db.deploy();
        ProcessDefinition pDef = repoSvc
                                 .createProcessDefinitionQuery()
                                 .deploymentId(d.getId())
                                 .singleResult();
       
        try {
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule.getRepositoryService();
    repositoryService.createDeployment().addInputStream("MultiInstanceBug.bpmn20.xml", new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("users", Arrays.asList(new Object[] {"user1", "user2", "user3"}));
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("MultiInstanceBug", 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("leave-qjsq.bpmn20.xml", new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
    variableMap.put("user", null);
    variableMap.put("users", Arrays.asList("user2", "user3"));
    variableMap.put("userGroup", new ArrayList<String>());
View Full Code Here

  public ObjectNode getEditorJson() {
    ObjectNode modelNode = null;
    String modelId = (String) getRequest().getAttributes().get("modelId");
   
    if(NumberUtils.isNumber(modelId)) {
      RepositoryService repositoryService = ProcessEngines.getDefaultProcessEngine().getRepositoryService();
      Model model = repositoryService.getModel(modelId);
     
      if (model != null) {
        try {
          modelNode = (ObjectNode) objectMapper.readTree(model.getMetaInfo());
          modelNode.put(MODEL_ID, model.getId());
          ObjectNode editorJsonNode = (ObjectNode) objectMapper.readTree(new String(repositoryService.getModelEditorSource(model.getId()), "utf-8"));
          modelNode.put("model", editorJsonNode);
         
        } catch(Exception e) {
          LOGGER.log(Level.SEVERE, "Error creating model JSON", e);
          setStatus(Status.SERVER_ERROR_INTERNAL);
View Full Code Here

      /*ObjectNode modelNode = (ObjectNode) objectMapper.readTree(modelForm.getFirstValue("json_xml"));
      JsonToBpmnExport converter = new JsonToBpmnExport(modelNode);
      byte[] bpmnBytes = converter.convert();
      System.out.println("bpmn " + new String(bpmnBytes));*/
     
      RepositoryService repositoryService = ProcessEngines.getDefaultProcessEngine().getRepositoryService();
      Model model = repositoryService.getModel(modelId);
     
      ObjectNode modelJson = (ObjectNode) objectMapper.readTree(model.getMetaInfo());
     
      modelJson.put(MODEL_NAME, modelForm.getFirstValue("name"));
      modelJson.put(MODEL_DESCRIPTION, modelForm.getFirstValue("description"));
      model.setMetaInfo(modelJson.toString());
      model.setName(modelForm.getFirstValue("name"));
     
      repositoryService.saveModel(model);
     
      repositoryService.addModelEditorSource(model.getId(), modelForm.getFirstValue("json_xml").getBytes("utf-8"));
      repositoryService.addModelEditorSourceExtra(model.getId(), modelForm.getFirstValue("svg_xml").getBytes("utf-8"));
     
    } catch(Exception e) {
      LOGGER.log(Level.SEVERE, "Error saving model", e);
      setStatus(Status.SERVER_ERROR_INTERNAL);
    }
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule.getRepositoryService();
    repositoryService.createDeployment().addInputStream("helloworld.jpdl.xml", new FileInputStream(filename)).deploy();
    List<Deployment> list = repositoryService.createDeploymentQuery().list();
    assertFalse(list.isEmpty());
    for (Deployment deployment : list) {
      System.out.println(deployment.getName());
    }
  }
View Full Code Here

  @Rule
  public ActivitiRule activitiRule = new ActivitiRule();

  @Test
  public void startProcess() throws Exception {
    RepositoryService repositoryService = activitiRule.getRepositoryService();
    repositoryService.createDeployment().addInputStream("EventSubprocess.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("EventSubprocess", 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("AutoCompleteTask.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("AutoCompleteTask", 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.