Java Code Examples for org.activiti.engine.impl.persistence.entity.ExecutionEntity#isActive()
The following examples show how to use
org.activiti.engine.impl.persistence.entity.ExecutionEntity#isActive() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CtrlrServlet.java From oneops with Apache License 2.0 | 6 votes |
/** * Test. * * @return the string */ @RequestMapping(method=RequestMethod.GET, value="/resumeall") @ResponseBody public String test() { logger.info("Resuming crashed processes!!!"); List<ProcessInstance> processes = runtimeService.createProcessInstanceQuery().active().list(); for (ProcessInstance process : processes) { ExecutionEntity exec = (ExecutionEntity)process; if (exec.isActive() && exec.getActivityId().equals("ackStart")) { exec.getId(); runtimeService.signal(exec.getId()); } } return "Resumed all processes"; }
Example 2
Source File: CounterSignCmd.java From lemon with Apache License 2.0 | 6 votes |
/** * <li>给串行实例集合中添加一个审批人 */ private void addSequentialInstance() { ExecutionEntity execution = getActivieExecutions().get(0); if (getActivity().getProperty("type").equals("subProcess")) { if (!execution.isActive() && execution.isEnded() && ((execution.getExecutions() == null) || (execution .getExecutions().size() == 0))) { execution.setActive(true); } } Collection<String> col = (Collection<String>) execution .getVariable(collectionVariableName); col.add(assignee); execution.setVariable(collectionVariableName, col); setLoopVariable(execution, "nrOfInstances", (Integer) execution.getVariableLocal("nrOfInstances") + 1); }
Example 3
Source File: CounterSignCmd.java From lemon with Apache License 2.0 | 6 votes |
/** * 获取活动的执行 , 子流程的活动执行是其孩子执行(并行多实例情况下) * 串行情况下获取的结果数量为1 */ protected List<ExecutionEntity> getActivieExecutions() { List<ExecutionEntity> activeExecutions = new ArrayList<ExecutionEntity>(); ActivityImpl activity = getActivity(); List<ExecutionEntity> executions = getChildExecutionByProcessInstanceId(); for (ExecutionEntity execution : executions) { if (execution.isActive() && (execution.getActivityId().equals(activityId) || activity .contains(execution.getActivity()))) { activeExecutions.add(execution); } } return activeExecutions; }
Example 4
Source File: EndExecutionOperation.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
protected int getNumberOfActiveChildExecutionsForProcessInstance(ExecutionEntityManager executionEntityManager, String processInstanceId) { Collection<ExecutionEntity> executions = executionEntityManager.findChildExecutionsByProcessInstanceId(processInstanceId); int activeExecutions = 0; for (ExecutionEntity execution : executions) { if (execution.isActive() && !processInstanceId.equals(execution.getId())) { activeExecutions++; } } return activeExecutions; }
Example 5
Source File: InactiveExecutionsInActivityAndProcInstMatcher.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@Override public boolean isRetained(ExecutionEntity executionEntity, Object parameter) { Map<String, Object> paramMap = (Map<String, Object>) parameter; String activityId = (String) paramMap.get("activityId"); String processInstanceId = (String) paramMap.get("processInstanceId"); return executionEntity.getProcessInstanceId() != null && executionEntity.getProcessInstanceId().equals(processInstanceId) && !executionEntity.isActive() && executionEntity.getActivityId() != null && executionEntity.getActivityId().equals(activityId); }
Example 6
Source File: InactiveExecutionsByProcInstMatcher.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@Override public boolean isRetained(ExecutionEntity executionEntity, Object parameter) { Map<String, Object> paramMap = (Map<String, Object>) parameter; String processInstanceId = (String) paramMap.get("processInstanceId"); return executionEntity.getProcessInstanceId() != null && executionEntity.getProcessInstanceId().equals(processInstanceId) && !executionEntity.isActive(); }
Example 7
Source File: FindActiveActivityIdsCmd.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
protected void collectActiveActivityIds(ExecutionEntity executionEntity, List<String> activeActivityIds) { if (executionEntity.isActive() && executionEntity.getActivityId() != null) { activeActivityIds.add(executionEntity.getActivityId()); } for (ExecutionEntity childExecution : executionEntity.getExecutions()) { collectActiveActivityIds(childExecution, activeActivityIds); } }
Example 8
Source File: InactiveExecutionsInActivityMatcher.java From activiti6-boot2 with Apache License 2.0 | 4 votes |
@Override public boolean isRetained(ExecutionEntity entity, Object parameter) { Map<String, Object> paramMap = (Map<String, Object>) parameter; String activityId = (String) paramMap.get("activityId"); return !entity.isActive() && entity.getActivityId() != null && entity.getActivityId().equals(activityId); }
Example 9
Source File: InclusiveGatewayActivityBehavior.java From activiti6-boot2 with Apache License 2.0 | 4 votes |
protected void executeInclusiveGatewayLogic(ExecutionEntity execution) { CommandContext commandContext = Context.getCommandContext(); ExecutionEntityManager executionEntityManager = commandContext.getExecutionEntityManager(); lockFirstParentScope(execution); Collection<ExecutionEntity> allExecutions = executionEntityManager.findChildExecutionsByProcessInstanceId(execution.getProcessInstanceId()); Iterator<ExecutionEntity> executionIterator = allExecutions.iterator(); boolean oneExecutionCanReachGateway = false; while (!oneExecutionCanReachGateway && executionIterator.hasNext()) { ExecutionEntity executionEntity = executionIterator.next(); if (!executionEntity.getActivityId().equals(execution.getCurrentActivityId())) { boolean canReachGateway = ExecutionGraphUtil.isReachable(execution.getProcessDefinitionId(), executionEntity.getActivityId(), execution.getCurrentActivityId()); if (canReachGateway) { oneExecutionCanReachGateway = true; } } else if (executionEntity.getActivityId().equals(execution.getCurrentActivityId()) && executionEntity.isActive()) { // Special case: the execution has reached the inc gw, but the operation hasn't been executed yet for that execution oneExecutionCanReachGateway = true; } } // If no execution can reach the gateway, the gateway activates and executes fork behavior if (!oneExecutionCanReachGateway) { logger.debug("Inclusive gateway cannot be reached by any execution and is activated"); // Kill all executions here (except the incoming) Collection<ExecutionEntity> executionsInGateway = executionEntityManager .findInactiveExecutionsByActivityIdAndProcessInstanceId(execution.getCurrentActivityId(), execution.getProcessInstanceId()); for (ExecutionEntity executionEntityInGateway : executionsInGateway) { if (!executionEntityInGateway.getId().equals(execution.getId())) { commandContext.getHistoryManager().recordActivityEnd(executionEntityInGateway, null); executionEntityManager.deleteExecutionAndRelatedData(executionEntityInGateway, null, false); } } // Leave commandContext.getAgenda().planTakeOutgoingSequenceFlowsOperation(execution, true); } }