Examples of ProcessInstance


Examples of com.exedosoft.wf.wfi.ProcessInstance

    DOFormModel aFm = (DOFormModel) doimodel;
    BOInstance bi = aFm.getData();
    if (bi != null && bi.getValue("contextPiUid") != null) {

      ProcessInstance pi = ProcessInstance.getProcessInstance(bi
          .getValue("contextPiUid"));
      if(pi==null){
        pi = ProcessInstance.getHisProcessInstance(bi.getValue("contextPiUid"));
      }
     
      if (pi!=null && pi.getProcessTemplate() != null
          && pi.getProcessTemplate().getDoBO() != null
          && pi.getProcessTemplate().getDoBO().getMainPaneModel() != null) {
        String instanceUid = bi.getValue("instance_uid");
        if(instanceUid!=null){
          data.put("busiBOName", pi.getProcessTemplate().getDoBO().getName());
          data.put("instance_uid", instanceUid);
        }
        data.put("paneModel", pi.getProcessTemplate().getDoBO()
            .getMainPaneModel());
      }
    } else if (aFm.getLinkPaneModel() != null) {
      data.put("paneModel", aFm.getLinkPaneModel());
    }
View Full Code Here

Examples of com.founder.fix.fixflow.core.runtime.ProcessInstance

   
    Map<String,Object> result = new HashMap<String,Object>();
    if(StringUtil.isNotEmpty(processInstanceId)){
      String userId = (String) filter.get("userId");
      ProcessEngine engine = getProcessEngine(userId);
      ProcessInstance processInstance = engine.getRuntimeService().getProcessInstance(processInstanceId);
      String processName = processInstance.getProcessDefinition().getName();
      try{
        TaskQuery tq = engine.getTaskService().createTaskQuery();
        IdentityService identityService = engine.getIdentityService();
        tq.processInstanceId(processInstanceId);
        tq.taskIsEnd().orderByEndTime().asc();
        List<TaskInstance> instances = tq.list();
        List<Map<String,Object>> instanceMaps = new ArrayList<Map<String,Object>>();
        for(TaskInstance tmp:instances){
          Map<String,Object> instanceMap = tmp.getPersistentState();
          String assigneeUserId = tmp.getAssignee();
          if(StringUtil.isNotEmpty(assigneeUserId)){
            UserTo tmpUser = identityService.getUserTo(assigneeUserId);
            if(tmpUser!=null){
              instanceMap.put("assgneeUserName", tmpUser.getUserName());
            }
          }else{
            instanceMap.put("assgneeUserName", "(空用户名)");
          }
          instanceMaps.add(instanceMap);
        }
        tq.taskNotEnd().orderByTaskCreateTime().asc();
        List<TaskInstance> instancesNotEnd = tq.list();
       
        List<Map<String,Object>> notEndInstanceMaps = new ArrayList<Map<String,Object>>();
        for(TaskInstance tmp:instancesNotEnd){
          Map<String,Object> instanceMap = tmp.getPersistentState();
          String assigneeUserId = tmp.getAssignee();
          if(StringUtil.isNotEmpty(assigneeUserId)){
            UserTo tmpUser = identityService.getUserTo(assigneeUserId);
            if(tmpUser!=null){
              instanceMap.put("assgneeUserName", tmpUser.getUserName());
            }
          }else{
            instanceMap.put("assgneeUserName", "(空用户名)");
          }
          notEndInstanceMaps.add(instanceMap);
        }
        Map<String,Map<String,Object>> postionMap = engine.getModelService().GetFlowGraphicsElementPosition(processInstance.getProcessDefinitionId());
        result.put("notEnddataList", notEndInstanceMaps);
        result.put("dataList", instanceMaps);
        result.put("positionInfo", JSONUtil.parseObject2JSON(postionMap));
        result.put("taskEndedJson", JSONUtil.parseObject2JSON(instanceMaps));
        result.put("taskNotEndJson", JSONUtil.parseObject2JSON(instancesNotEnd));
View Full Code Here

Examples of com.starflow.wf.engine.model.ProcessInstance

      isStart = false;
    else if(Constants.ACT_ACTIVATE_RULE_LOGIC.equalsIgnoreCase(activityXml.getActivateRuleType())) {
      String beanName = activityXml.getStartStrategybyAppAction();
     
      try {
        ProcessInstance cloneProcessInstance = new ProcessInstance();
        BeanUtils.copyProperties(event.getProcessInstance(), cloneProcessInstance);
        ActivityInst cloneActivityInst = new ActivityInst();
        BeanUtils.copyProperties(activityInst, cloneActivityInst);
        isStart = executeActivateRule(beanName, cloneProcessInstance, cloneActivityInst);
      } catch (Exception e) {
View Full Code Here

Examples of org.activiti.engine.runtime.ProcessInstance

  @Deployment(resources = "EasyBugFilingProcess.bpmn20.xml")
  public void testHappyPath() {
    HashMap<String, Object> variables = new HashMap<String, Object>();
    variables.put("email", "bernd.ruecker@camunda.com");
   
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("EasyBugFilingProcess", variables);
    String id = processInstance.getId();
    System.out.println("Started process instance id " + id);
    assertInActivity(id, "Handle_bug");
   
    Task task = taskService.createTaskQuery().taskAssignee("kermit").singleResult();
    variables = new HashMap<String, Object>();
View Full Code Here

Examples of org.camunda.bpm.engine.runtime.ProcessInstance

    when(mockCaseExecutionQuery.list()).thenReturn(caseExecutions);
    when(mockCaseService.createCaseExecutionQuery()).thenReturn(mockCaseExecutionQuery);
  }

  private void createProcessInstanceMock() {
    ProcessInstance mockInstance = MockProvider.createMockInstance();

    ProcessInstanceQuery mockInstanceQuery = mock(ProcessInstanceQuery.class);
    when(mockInstanceQuery.processInstanceId(eq(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID))).thenReturn(mockInstanceQuery);
    when(mockInstanceQuery.singleResult()).thenReturn(mockInstance);
    when(mockRuntimeService.createProcessInstanceQuery()).thenReturn(mockInstanceQuery);
View Full Code Here

Examples of org.drools.process.instance.ProcessInstance

    public void completeWorkItem(long id, Map<String, Object> results) {
        WorkItem workItem = (WorkItem) workItems.get(new Long(id));
        // work item may have been aborted
        if (workItem != null) {
            ((org.drools.process.instance.WorkItem) workItem).setResults(results);
            ProcessInstance processInstance = ( ProcessInstance ) workingMemory.getProcessInstance(workItem.getProcessInstanceId());
            ((org.drools.process.instance.WorkItem) workItem).setState(WorkItem.COMPLETED);
            // process instance may have finished already
            if (processInstance != null) {
                processInstance.signalEvent("workItemCompleted", workItem);
            }
            workItems.remove(new Long(id));
            workingMemory.fireAllRules();
        }
    }
View Full Code Here

Examples of org.drools.ruleflow.common.instance.ProcessInstance

    protected SubFlowNode getSubFlowNode() {
        return (SubFlowNode) getNode();
    }

    public void trigger(final RuleFlowNodeInstance from) {
      ProcessInstance processInstance =
        getProcessInstance().getWorkingMemory().startProcess(getSubFlowNode().getProcessId());
      if (processInstance.getState() == ProcessInstance.STATE_COMPLETED) {
        triggerCompleted();
      } else {
        this.processInstanceId = processInstance.getId();
      }
    }
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance

public class ProcessSubProcessTest extends JbpmTestCase {

    public void testSubProcess() throws Exception {
        RuleBase ruleBase = readRule(true);
        WorkingMemory workingMemory = ruleBase.newStatefulSession();
        ProcessInstance processInstance = ( ProcessInstance )
        workingMemory.startProcess("com.sample.ruleflow");
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        assertEquals(2, workingMemory.getProcessInstances().size());
        workingMemory.insert(new Person());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals(0, workingMemory.getProcessInstances().size());
    }
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance

    public void testDynamicSubProcess() throws Exception {
        RuleBase ruleBase = readDynamicSubProcess();
        WorkingMemory workingMemory = ruleBase.newStatefulSession();
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("x", "subflow");
        ProcessInstance processInstance = ( ProcessInstance )
        workingMemory.startProcess("com.sample.ruleflow", params);
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        assertEquals(2, workingMemory.getProcessInstances().size());
        workingMemory.insert(new Person());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
        assertEquals(0, workingMemory.getProcessInstances().size());
    }
View Full Code Here

Examples of org.drools.runtime.process.ProcessInstance

        workingMemory.fireAllRules();
        assertEquals( 0,
                      list.size() );

        final ProcessInstance processInstance = workingMemory.startProcess( "0" );
        assertEquals( ProcessInstance.STATE_ACTIVE,
                      processInstance.getState() );
        workingMemory.fireAllRules();
        assertEquals( 4,
                      list.size() );
        assertEquals( "Rule1",
                      list.get( 0 ) );
        assertEquals( "Rule3",
                      list.get( 1 ) );
        assertEquals( "Rule2",
                      list.get( 2 ) );
        assertEquals( "Rule4",
                      list.get( 3 ) );
        assertEquals( ProcessInstance.STATE_COMPLETED,
                      processInstance.getState() );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.