org.activiti.engine.impl.pvm.process.ActivityImpl Java Examples
The following examples show how to use
org.activiti.engine.impl.pvm.process.ActivityImpl.
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: TimerStartEventJobHandler.java From flowable-engine with Apache License 2.0 | 7 votes |
protected void startProcessInstanceWithInitialActivity(Job job, String configuration, DeploymentManager deploymentManager, CommandContext commandContext) { ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) deploymentManager.findDeployedProcessDefinitionById(job.getProcessDefinitionId()); String activityId = getActivityIdFromConfiguration(configuration); ActivityImpl startActivity = processDefinition.findActivity(activityId); if (!deploymentManager.isProcessDefinitionSuspended(processDefinition.getId())) { dispatchTimerFiredEvent(job, commandContext); ExecutionEntity processInstance = processDefinition.createProcessInstance(null, startActivity); processInstance.start(); } else { LOGGER.debug("Ignoring timer of suspended process definition {}", processDefinition.getId()); } }
Example #2
Source File: RollbackTaskCmd.java From lemon with Apache License 2.0 | 6 votes |
/** * 找到想要回退对应的任务历史. */ public HistoricTaskInstanceEntity findTargetHistoricTask( CommandContext commandContext, TaskEntity taskEntity, ActivityImpl activityImpl) { HistoricTaskInstanceQueryImpl historicTaskInstanceQueryImpl = new HistoricTaskInstanceQueryImpl(); historicTaskInstanceQueryImpl.taskDefinitionKey(activityImpl.getId()); historicTaskInstanceQueryImpl.processInstanceId(taskEntity .getProcessInstanceId()); historicTaskInstanceQueryImpl.setFirstResult(0); historicTaskInstanceQueryImpl.setMaxResults(1); historicTaskInstanceQueryImpl.orderByTaskCreateTime().desc(); HistoricTaskInstanceEntity historicTaskInstanceEntity = (HistoricTaskInstanceEntity) commandContext .getHistoricTaskInstanceEntityManager() .findHistoricTaskInstancesByQueryCriteria( historicTaskInstanceQueryImpl).get(0); return historicTaskInstanceEntity; }
Example #3
Source File: JumpToActivityCmd.java From lemon with Apache License 2.0 | 6 votes |
public Object execute(CommandContext commandContext) { for (TaskEntity taskEntity : commandContext.getTaskEntityManager() .findTasksByExecutionId(executionId)) { taskEntity.setVariableLocal("跳转原因", jumpOrigin); commandContext.getTaskEntityManager().deleteTask(taskEntity, jumpOrigin, false); } ExecutionEntity executionEntity = commandContext .getExecutionEntityManager().findExecutionById(executionId); ProcessDefinitionImpl processDefinition = executionEntity .getProcessDefinition(); ActivityImpl activity = processDefinition.findActivity(activityId); executionEntity.executeActivity(activity); return null; }
Example #4
Source File: DefaultTaskFlowControlService.java From openwebflow with BSD 2-Clause "Simplified" License | 6 votes |
/** * 分裂某节点为多实例节点 * * @param targetTaskDefinitionKey * @param assignee * @throws IOException * @throws IllegalAccessException * @throws IllegalArgumentException */ @Override public ActivityImpl split(String targetTaskDefinitionKey, boolean isSequential, String... assignees) throws Exception { SimpleRuntimeActivityDefinitionEntity info = new SimpleRuntimeActivityDefinitionEntity(); info.setProcessDefinitionId(_processDefinition.getId()); info.setProcessInstanceId(_processInstanceId); RuntimeActivityDefinitionEntityIntepreter radei = new RuntimeActivityDefinitionEntityIntepreter(info); radei.setPrototypeActivityId(targetTaskDefinitionKey); radei.setAssignees(CollectionUtils.arrayToList(assignees)); radei.setSequential(isSequential); ActivityImpl clone = new MultiInstanceActivityCreator().createActivities(_processEngine, _processDefinition, info)[0]; TaskEntity currentTaskEntity = getCurrentTask(); executeCommand(new CreateAndTakeTransitionCmd(currentTaskEntity.getExecutionId(), clone)); executeCommand(new DeleteRunningTaskCmd(currentTaskEntity)); recordActivitiesCreation(info); return clone; }
Example #5
Source File: BpmResource.java From lemon with Apache License 2.0 | 6 votes |
private void getHighlightedFlows(List<ActivityImpl> activityList) { for (ActivityImpl activity : activityList) { if (activity.getProperty("type").equals("subProcess")) { // get flows for the subProcess getHighlightedFlows(activity.getActivities()); } if (historicActivityInstanceList.contains(activity.getId())) { List<PvmTransition> pvmTransitionList = activity .getOutgoingTransitions(); for (PvmTransition pvmTransition : pvmTransitionList) { String destinationFlowId = pvmTransition.getDestination() .getId(); if (historicActivityInstanceList .contains(destinationFlowId)) { highLightedFlows.add(pvmTransition.getId()); } } } } }
Example #6
Source File: ProcessCustomService.java From maven-framework-project with MIT License | 6 votes |
/** * 根据当前节点,查询输出流向是否为并行终点,如果为并行终点,则拼装对应的并行起点ID * * @param activityImpl * 当前节点 * @return */ private static String findParallelGatewayId(ActivityImpl activityImpl) { List<PvmTransition> incomingTransitions = activityImpl .getOutgoingTransitions(); for (PvmTransition pvmTransition : incomingTransitions) { TransitionImpl transitionImpl = (TransitionImpl) pvmTransition; activityImpl = transitionImpl.getDestination(); String type = (String) activityImpl.getProperty("type"); if ("parallelGateway".equals(type)) {// 并行路线 String gatewayId = activityImpl.getId(); String gatewayType = gatewayId.substring(gatewayId .lastIndexOf("_") + 1); if ("END".equals(gatewayType.toUpperCase())) { return gatewayId.substring(0, gatewayId.lastIndexOf("_")) + "_start"; } } } return null; }
Example #7
Source File: TimerExecuteNestedActivityJobHandler.java From flowable-engine with Apache License 2.0 | 6 votes |
protected void dispatchExecutionTimeOut(Job job, ExecutionEntity execution, CommandContext commandContext) { // subprocesses for (ExecutionEntity subExecution : execution.getExecutions()) { dispatchExecutionTimeOut(job, subExecution, commandContext); } // call activities ExecutionEntity subProcessInstance = commandContext.getExecutionEntityManager().findSubProcessInstanceBySuperExecutionId(execution.getId()); if (subProcessInstance != null) { dispatchExecutionTimeOut(job, subProcessInstance, commandContext); } // activity with timer boundary event ActivityImpl activity = execution.getActivity(); if (activity != null && activity.getActivityBehavior() != null) { dispatchActivityTimeOut(job, activity, execution, commandContext); } }
Example #8
Source File: ProcessExtensionServiceImpl.java From activiti-demo with Apache License 2.0 | 6 votes |
/** * 流程转向操作 * @param taskId 当前任务ID * @param activityId 目标节点任务ID * @param variables 流程变量 * @throws Exception */ private void turnTransition(String taskId,String activityId,Map<String,Object> variables)throws Exception{ //当前节点 ActivityImpl currActivity = findActivitiImpl(taskId,null); //清空当前流向 List<PvmTransition> oriPvmTransitionList = clearTransition(currActivity); //创建新流向 TransitionImpl newTransition = currActivity.createOutgoingTransition(); //目标节点 ActivityImpl pointActivity = findActivitiImpl(taskId,activityId); //设置新流向的目标节点 newTransition.setDestination(pointActivity); //执行转向任务 taskService.complete(taskId,variables); //删除目标节点新流入 pointActivity.getIncomingTransitions().remove(newTransition); }
Example #9
Source File: TerminateEndEventActivityBehavior.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override public void execute(DelegateExecution delegateExecution) { ActivityExecution execution = (ActivityExecution) delegateExecution; ActivityImpl terminateEndEventActivity = (ActivityImpl) execution.getActivity(); if (terminateAll) { ActivityExecution processInstanceExecution = findRootProcessInstanceExecution((ExecutionEntity) execution); terminateProcessInstanceExecution(execution, terminateEndEventActivity, processInstanceExecution); } else { ActivityExecution scopeExecution = ScopeUtil.findScopeExecution(execution); if (scopeExecution != null) { terminateExecution(execution, terminateEndEventActivity, scopeExecution); } } }
Example #10
Source File: RollbackTaskCmd.java From lemon with Apache License 2.0 | 6 votes |
/** * 找到想要回退对应的节点历史. */ public HistoricActivityInstanceEntity findTargetHistoricActivity( CommandContext commandContext, TaskEntity taskEntity, ActivityImpl activityImpl) { HistoricActivityInstanceQueryImpl historicActivityInstanceQueryImpl = new HistoricActivityInstanceQueryImpl(); historicActivityInstanceQueryImpl.activityId(activityImpl.getId()); historicActivityInstanceQueryImpl.processInstanceId(taskEntity .getProcessInstanceId()); historicActivityInstanceQueryImpl .orderByHistoricActivityInstanceEndTime().desc(); HistoricActivityInstanceEntity historicActivityInstanceEntity = (HistoricActivityInstanceEntity) commandContext .getHistoricActivityInstanceEntityManager() .findHistoricActivityInstancesByQueryCriteria( historicActivityInstanceQueryImpl, new Page(0, 1)) .get(0); return historicActivityInstanceEntity; }
Example #11
Source File: RuntimeActivityCreatorSupport.java From openwebflow with BSD 2-Clause "Simplified" License | 6 votes |
protected ActivityImpl createActivity(ProcessEngine processEngine, ProcessDefinitionEntity processDefinition, ActivityImpl prototypeActivity, String cloneActivityId, String assignee) { ActivityImpl clone = cloneActivity(processDefinition, prototypeActivity, cloneActivityId, "executionListeners", "properties"); //设置assignee UserTaskActivityBehavior activityBehavior = (UserTaskActivityBehavior) (prototypeActivity.getActivityBehavior()); TaskDefinition taskDefinition = cloneTaskDefinition(activityBehavior.getTaskDefinition()); taskDefinition.setKey(cloneActivityId); if (assignee != null) { taskDefinition.setAssigneeExpression(new FixedValue(assignee)); } UserTaskActivityBehavior cloneActivityBehavior = new UserTaskActivityBehavior(prototypeActivity.getId(), taskDefinition); clone.setActivityBehavior(cloneActivityBehavior); return clone; }
Example #12
Source File: EventScopeCreatingSubprocess.java From flowable-engine with Apache License 2.0 | 6 votes |
@SuppressWarnings("unchecked") public void lastExecutionEnded(ActivityExecution execution) { ActivityExecution outgoingExecution = execution.getParent().createExecution(); outgoingExecution.setConcurrent(false); ((InterpretableExecution) outgoingExecution).setActivity((ActivityImpl) execution.getActivity()); // eventscope execution execution.setConcurrent(false); execution.setActive(false); ((InterpretableExecution) execution).setEventScope(true); List<PvmTransition> outgoingTransitions = execution.getActivity().getOutgoingTransitions(); if (outgoingTransitions.isEmpty()) { outgoingExecution.end(); } else { outgoingExecution.takeAll(outgoingTransitions, Collections.EMPTY_LIST); } }
Example #13
Source File: TraceProcessController.java From activiti-in-action-codes with Apache License 2.0 | 6 votes |
/** * 封装输出信息,包括:当前节点的X、Y坐标、变量信息、任务类型、任务描述 * * @param activity * @param currentActiviti * @return */ private Map<String, Object> packageSingleActivitiInfo(ActivityImpl activity, String executionId, boolean currentActiviti) throws Exception { Map<String, Object> activityInfo = new HashMap<String, Object>(); activityInfo.put("currentActiviti", currentActiviti); // 设置图形的XY坐标以及宽度、高度 setSizeAndPositonInfo(activity, activityInfo); Map<String, Object> vars = new HashMap<String, Object>(); Map<String, Object> properties = activity.getProperties(); vars.put("任务类型", ActivityUtil.getZhActivityType(properties.get("type").toString())); vars.put("任务名称", properties.get("name")); // 当前节点的task if (currentActiviti) { setCurrentTaskInfo(executionId, activity.getId(), vars); } logger.debug("trace variables: {}", vars); activityInfo.put("vars", vars); return activityInfo; }
Example #14
Source File: AtomicOperationTransitionCreateScope.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override public void execute(InterpretableExecution execution) { InterpretableExecution propagatingExecution = null; ActivityImpl activity = (ActivityImpl) execution.getActivity(); if (activity.isScope()) { propagatingExecution = (InterpretableExecution) execution.createExecution(); propagatingExecution.setActivity(activity); propagatingExecution.setTransition(execution.getTransition()); execution.setTransition(null); execution.setActivity(null); execution.setActive(false); LOGGER.debug("create scope: parent {} continues as execution {}", execution, propagatingExecution); propagatingExecution.initialize(); } else { propagatingExecution = execution; } propagatingExecution.performOperation(AtomicOperation.TRANSITION_NOTIFY_LISTENER_START); }
Example #15
Source File: AtomicOperationProcessStart.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override protected void eventNotificationsCompleted(InterpretableExecution execution) { if (Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { Map<String, Object> variablesMap = null; try { variablesMap = execution.getVariables(); } catch (Throwable t) { // In some rare cases getting the execution variables can fail (JPA entity load failure for example) // We ignore the exception here, because it's only meant to include variables in the initialized event. } Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent( ActivitiEventBuilder.createEntityWithVariablesEvent(FlowableEngineEventType.ENTITY_INITIALIZED, execution, variablesMap, false)); Context.getProcessEngineConfiguration().getEventDispatcher() .dispatchEvent(ActivitiEventBuilder.createProcessStartedEvent(execution, variablesMap, false)); } ProcessDefinitionImpl processDefinition = execution.getProcessDefinition(); StartingExecution startingExecution = execution.getStartingExecution(); List<ActivityImpl> initialActivityStack = processDefinition.getInitialActivityStack(startingExecution.getInitial()); execution.setActivity(initialActivityStack.get(0)); execution.performOperation(PROCESS_START_INITIAL); }
Example #16
Source File: AtomicOperationDeleteCascadeFireActivityEnd.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override protected void eventNotificationsCompleted(InterpretableExecution execution) { ActivityImpl activity = (ActivityImpl) execution.getActivity(); if ((execution.isScope()) && (activity != null)) { execution.setActivity(activity.getParentActivity()); execution.performOperation(AtomicOperation.DELETE_CASCADE_FIRE_ACTIVITY_END); } else { if (execution.isScope()) { execution.destroy(); } execution.remove(); if (!execution.isDeleteRoot()) { InterpretableExecution parent = (InterpretableExecution) execution.getParent(); if (parent != null) { parent.performOperation(AtomicOperation.DELETE_CASCADE); } } } }
Example #17
Source File: SimpleFlowWorkController.java From activiti-demo with Apache License 2.0 | 5 votes |
/** * 跳转到任务执行页面 * @param request * @return */ @RequestMapping(value = "/form.do") public String from(HttpServletRequest request, @RequestParam("taskId")String taskId, Model model){ List<Task> taskList = taskService.createTaskQuery().taskId(taskId).list(); Task task = taskList.get(0); //获取表单数据 TaskFormData tfd = formService.getTaskFormData(taskId); List<FormProperty> fpList = tfd.getFormProperties(); Map map = runtimeService.getVariables(task.getExecutionId()); List<ActivityImpl> activityList = new ArrayList<ActivityImpl>(); try { //查找所有可驳回的节点 activityList = processExtensionService.findBackActivity(taskId); //model.addAttribute("activityList",activityList); }catch (Exception e){ e.printStackTrace(); } // model.addAttribute("task",task); // model.addAttribute("fpList",fpList); // model.addAttribute("map",map); // model.addAttribute("taskId",taskId); request.setAttribute("task", task); request.setAttribute("fpList", fpList); request.setAttribute("map", map); request.setAttribute("taskId", taskId); request.setAttribute("activityList", activityList); return "/simple/form"; }
Example #18
Source File: TraceProcessController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
private List<String> getHighLightedFlows(ProcessDefinitionEntity processDefinition, String processInstanceId) { List<String> highLightedFlows = new ArrayList<String>(); List<HistoricActivityInstance> historicActivityInstances = historyService .createHistoricActivityInstanceQuery() .processInstanceId(processInstanceId) .orderByHistoricActivityInstanceStartTime().asc().list(); List<String> historicActivityInstanceList = new ArrayList<String>(); for (HistoricActivityInstance hai : historicActivityInstances) { historicActivityInstanceList.add(hai.getActivityId()); } // add current activities to list List<String> highLightedActivities = runtimeService.getActiveActivityIds(processInstanceId); historicActivityInstanceList.addAll(highLightedActivities); // activities and their sequence-flows for (ActivityImpl activity : processDefinition.getActivities()) { int index = historicActivityInstanceList.indexOf(activity.getId()); if (index >= 0 && index + 1 < historicActivityInstanceList.size()) { List<PvmTransition> pvmTransitionList = activity .getOutgoingTransitions(); for (PvmTransition pvmTransition : pvmTransitionList) { String destinationFlowId = pvmTransition.getDestination().getId(); if (destinationFlowId.equals(historicActivityInstanceList.get(index + 1))) { highLightedFlows.add(pvmTransition.getId()); } } } } return highLightedFlows; }
Example #19
Source File: TraceProcessController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 设置宽度、高度、坐标属性 * * @param activity * @param activityInfo */ private void setSizeAndPositonInfo(ActivityImpl activity, Map<String, Object> activityInfo) { activityInfo.put("width", activity.getWidth()); activityInfo.put("height", activity.getHeight()); activityInfo.put("x", activity.getX()); activityInfo.put("y", activity.getY()); }
Example #20
Source File: TraceProcessController.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
/** * 设置宽度、高度、坐标属性 * * @param activity * @param activityInfo */ private void setSizeAndPositonInfo(ActivityImpl activity, Map<String, Object> activityInfo) { activityInfo.put("width", activity.getWidth()); activityInfo.put("height", activity.getHeight()); activityInfo.put("x", activity.getX()); activityInfo.put("y", activity.getY()); }
Example #21
Source File: ProcessExtensionServiceImpl.java From activiti-demo with Apache License 2.0 | 5 votes |
/** * 还原指定活动节点流向 * @param activityImpl 活动节点 * @param oriPvmTransitionList 原有节点流向集合 */ private static void restoreTransition(ActivityImpl activityImpl,List<PvmTransition> oriPvmTransitionList){ //清空现有流向 List<PvmTransition> pvmTransitionList = activityImpl.getOutgoingTransitions(); pvmTransitionList.clear(); for(PvmTransition pvmTransition:oriPvmTransitionList){ pvmTransitionList.add(pvmTransition); } }
Example #22
Source File: WorkflowTraceService.java From maven-framework-project with MIT License | 5 votes |
/** * 流程跟踪图 * @param processInstanceId 流程实例ID * @return 封装了各种节点信息 */ public List<Map<String, Object>> traceProcess(String processInstanceId) throws Exception { //根据流程实例获取流程节点 Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();//执行实例 Object property = PropertyUtils.getProperty(execution, "activityId"); String activityId = ""; if (property != null) { activityId = property.toString(); } //查询流程实例 ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); //根据流程定义id查询流程定义 ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(processInstance.getProcessDefinitionId()); //获取该流程定义的所有节点 List<ActivityImpl> activitiList = processDefinition.getActivities();//获得当前任务的所有节点 List<Map<String, Object>> activityInfos = new ArrayList<Map<String, Object>>(); for (ActivityImpl activity : activitiList) { boolean currentActiviti = false; String id = activity.getId(); // 判断是否是当前节点 if (id.equals(activityId)) { currentActiviti = true; } Map<String, Object> activityImageInfo = packageSingleActivitiInfo(activity, processInstance, currentActiviti); activityInfos.add(activityImageInfo); } return activityInfos; }
Example #23
Source File: CheckWithdrawTaskCmd.java From lemon with Apache License 2.0 | 5 votes |
public ActivityImpl getActivity( HistoricActivityInstanceEntity historicActivityInstanceEntity) { ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd( historicActivityInstanceEntity.getProcessDefinitionId()) .execute(Context.getCommandContext()); return processDefinitionEntity .findActivity(historicActivityInstanceEntity.getActivityId()); }
Example #24
Source File: SubProcessParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, SubProcess subProcess) { ActivityImpl activity = createActivityOnScope(bpmnParse, subProcess, BpmnXMLConstants.ELEMENT_SUBPROCESS, bpmnParse.getCurrentScope()); activity.setAsync(subProcess.isAsynchronous()); activity.setExclusive(!subProcess.isNotExclusive()); boolean triggeredByEvent = false; if (subProcess instanceof EventSubProcess) { triggeredByEvent = true; } activity.setProperty("triggeredByEvent", triggeredByEvent); // event subprocesses are not scopes activity.setScope(!triggeredByEvent); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createSubprocActivityBehavior(subProcess)); bpmnParse.setCurrentScope(activity); bpmnParse.setCurrentSubProcess(subProcess); bpmnParse.processFlowElements(subProcess.getFlowElements()); processArtifacts(bpmnParse, subProcess.getArtifacts(), activity); // no data objects for event subprocesses if (!(subProcess instanceof EventSubProcess)) { // parse out any data objects from the template in order to set up the necessary process variables Map<String, Object> variables = processDataObjects(bpmnParse, subProcess.getDataObjects(), activity); activity.setVariables(variables); } bpmnParse.removeCurrentScope(); bpmnParse.removeCurrentSubProcess(); }
Example #25
Source File: EventBasedGatewayParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
@Override protected void executeParse(BpmnParse bpmnParse, EventGateway gateway) { ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, gateway, BpmnXMLConstants.ELEMENT_GATEWAY_EVENT); activity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createEventBasedGatewayActivityBehavior(gateway)); activity.setAsync(gateway.isAsynchronous()); activity.setExclusive(!gateway.isNotExclusive()); activity.setScope(true); }
Example #26
Source File: ActTaskService.java From Shop-for-JavaWeb with MIT License | 5 votes |
/** * 流程跟踪图信息 * @param processInstanceId 流程实例ID * @return 封装了各种节点信息 */ public List<Map<String, Object>> traceProcess(String processInstanceId) throws Exception { Execution execution = runtimeService.createExecutionQuery().executionId(processInstanceId).singleResult();//执行实例 Object property = PropertyUtils.getProperty(execution, "activityId"); String activityId = ""; if (property != null) { activityId = property.toString(); } ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId) .singleResult(); ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService) .getDeployedProcessDefinition(processInstance.getProcessDefinitionId()); List<ActivityImpl> activitiList = processDefinition.getActivities();//获得当前任务的所有节点 List<Map<String, Object>> activityInfos = new ArrayList<Map<String, Object>>(); for (ActivityImpl activity : activitiList) { boolean currentActiviti = false; String id = activity.getId(); // 当前节点 if (id.equals(activityId)) { currentActiviti = true; } Map<String, Object> activityImageInfo = packageSingleActivitiInfo(activity, processInstance, currentActiviti); activityInfos.add(activityImageInfo); } return activityInfos; }
Example #27
Source File: ProcessCustomService.java From maven-framework-project with MIT License | 5 votes |
/** * 反向排序list集合,便于驳回节点按顺序显示 * * @param list * @return */ private static List<ActivityImpl> reverList(List<ActivityImpl> list) { List<ActivityImpl> rtnList = new ArrayList<ActivityImpl>(); // 由于迭代出现重复数据,排除重复 for (int i = list.size(); i > 0; i--) { if (!rtnList.contains(list.get(i - 1))) rtnList.add(list.get(i - 1)); } return rtnList; }
Example #28
Source File: ProcessEngineTool.java From openwebflow with BSD 2-Clause "Simplified" License | 5 votes |
/** * 设置指定活动的用户权限,包括钦定用户、候选用户、候选组 */ public void grantPermission(ActivityImpl activity, String assigneeExpression, String candidateGroupIdExpressions, String candidateUserIdExpressions) throws Exception { ProcessDefinitionUtils.grantPermission(activity, assigneeExpression, candidateGroupIdExpressions, candidateUserIdExpressions); }
Example #29
Source File: StartEventParseHandler.java From flowable-engine with Apache License 2.0 | 5 votes |
protected void createScopeStartEvent(BpmnParse bpmnParse, ActivityImpl startEventActivity, StartEvent startEvent) { ScopeImpl scope = bpmnParse.getCurrentScope(); Object triggeredByEvent = scope.getProperty("triggeredByEvent"); boolean isTriggeredByEvent = triggeredByEvent != null && ((Boolean) triggeredByEvent); if (isTriggeredByEvent) { // event subprocess // all start events of an event subprocess share common behavior EventSubProcessStartEventActivityBehavior activityBehavior = bpmnParse.getActivityBehaviorFactory().createEventSubProcessStartEventActivityBehavior(startEvent, startEventActivity.getId()); startEventActivity.setActivityBehavior(activityBehavior); if (!startEvent.getEventDefinitions().isEmpty()) { EventDefinition eventDefinition = startEvent.getEventDefinitions().get(0); if (eventDefinition instanceof org.flowable.bpmn.model.ErrorEventDefinition || eventDefinition instanceof MessageEventDefinition || eventDefinition instanceof SignalEventDefinition) { bpmnParse.getBpmnParserHandlers().parseElement(bpmnParse, eventDefinition); } else { LOGGER.warn("start event of event subprocess must be of type 'error', 'message' or 'signal' for start event {}", startEvent.getId()); } } } else { // "regular" subprocess if (!startEvent.getEventDefinitions().isEmpty()) { LOGGER.warn("event definitions only allowed on start event if subprocess is an event subprocess {}", bpmnParse.getCurrentSubProcess().getId()); } if (scope.getProperty(PROPERTYNAME_INITIAL) == null) { scope.setProperty(PROPERTYNAME_INITIAL, startEventActivity); startEventActivity.setActivityBehavior(bpmnParse.getActivityBehaviorFactory().createNoneStartEventActivityBehavior(startEvent)); } else { LOGGER.warn("multiple start events not supported for subprocess {}", bpmnParse.getCurrentSubProcess().getId()); } } }
Example #30
Source File: RollbackTaskCmd.java From lemon with Apache License 2.0 | 5 votes |
/** * 获得历史节点对应的节点信息. */ public ActivityImpl getActivity( HistoricActivityInstanceEntity historicActivityInstanceEntity) { ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd( historicActivityInstanceEntity.getProcessDefinitionId()) .execute(Context.getCommandContext()); return processDefinitionEntity .findActivity(historicActivityInstanceEntity.getActivityId()); }