Java Code Examples for org.activiti.engine.impl.persistence.entity.ExecutionEntity#executeActivity()
The following examples show how to use
org.activiti.engine.impl.persistence.entity.ExecutionEntity#executeActivity() .
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: JumpActivityCmd.java From activiti-in-action-codes with Apache License 2.0 | 6 votes |
public ExecutionEntity execute(CommandContext commandContext) { // 查询活动的分支 ExecutionEntity executionEntity = commandContext.getExecutionEntityManager().findExecutionById(processInstanceId); // 销毁当前分支 executionEntity.destroyScope(jumpOrigin); // 从流程定义中查询目标Activity ProcessDefinitionImpl processDefinition = executionEntity.getProcessDefinition(); ActivityImpl activity = processDefinition.findActivity(activityId); // 节点跳转到目标活动 executionEntity.executeActivity(activity); return executionEntity; }
Example 2
Source File: JumpCmd.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); executionEntity.destroyScope(jumpOrigin); ProcessDefinitionImpl processDefinition = executionEntity .getProcessDefinition(); ActivityImpl activity = processDefinition.findActivity(activityId); executionEntity.executeActivity(activity); return null; }
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: JumpTaskCmd.java From hsweb-framework with Apache License 2.0 | 5 votes |
@Override public Comment execute(CommandContext commandContext) { for (TaskEntity taskEntity : commandContext.getTaskEntityManager().findTasksByExecutionId(executionId)) { commandContext.getTaskEntityManager().deleteTask(taskEntity, "jump", false); } ExecutionEntity executionEntity = Context.getCommandContext().getExecutionEntityManager().findExecutionById(executionId); ProcessDefinitionImpl processDefinition = executionEntity.getProcessDefinition(); ActivityImpl activity = processDefinition.findActivity(activityId); executionEntity.executeActivity(activity); return null; }
Example 5
Source File: CounterSignCmd.java From lemon with Apache License 2.0 | 5 votes |
/** * <li>添加一条并行实例 */ private void addParallelInstance() { ExecutionEntity parentExecutionEntity = commandContext .getExecutionEntityManager() .findExecutionById(processInstanceId).findExecution(activityId); ActivityImpl activity = getActivity(); ExecutionEntity execution = parentExecutionEntity.createExecution(); execution.setActive(true); execution.setConcurrent(true); execution.setScope(false); if (getActivity().getProperty("type").equals("subProcess")) { ExecutionEntity extraScopedExecution = execution.createExecution(); extraScopedExecution.setActive(true); extraScopedExecution.setConcurrent(false); extraScopedExecution.setScope(true); execution = extraScopedExecution; } setLoopVariable(parentExecutionEntity, "nrOfInstances", (Integer) parentExecutionEntity .getVariableLocal("nrOfInstances") + 1); setLoopVariable(parentExecutionEntity, "nrOfActiveInstances", (Integer) parentExecutionEntity .getVariableLocal("nrOfActiveInstances") + 1); setLoopVariable(execution, "loopCounter", parentExecutionEntity .getExecutions().size() + 1); setLoopVariable(execution, collectionElementVariableName, assignee); execution.executeActivity(activity); }