提交 61493659 编写于 作者: T Tijs Rademakers

Merge branch 'activiti6' of https://github.com/Activiti/Activiti into activiti6

......@@ -55,8 +55,7 @@ public class ContinueProcessOperation extends AbstractOperation {
if (currentFlowElement == null) {
currentFlowElement = findCurrentFlowElement(execution);
} else {
execution.setCurrentActivityId(currentFlowElement.getId());
execution.setCurrentFlowElement(currentFlowElement);
}
if (currentFlowElement instanceof FlowNode) {
......@@ -181,7 +180,6 @@ public class ContinueProcessOperation extends AbstractOperation {
ExecutionEntity childExecutionEntity = (ExecutionEntity) execution.createExecution();
childExecutionEntity.setParentId(execution.getId());
childExecutionEntity.setCurrentFlowElement(boundaryEvent);
childExecutionEntity.setCurrentActivityId(boundaryEvent.getId());
childExecutionEntity.setScope(false);
ActivityBehavior boundaryEventBehavior = ((ActivityBehavior) boundaryEvent.getBehavior());
......
......@@ -87,7 +87,7 @@ public class EndExecutionOperation extends AbstractOperation {
Collection<ExecutionEntity> executions = executionEntityManager.findChildExecutionsByProcessInstanceId(processInstanceId);
int activeExecutions = 0;
for (ExecutionEntity execution : executions) {
if (execution.isActive()) {
if (execution.isActive() && !processInstanceId.equals(execution.getId())) {
activeExecutions++;
}
}
......
......@@ -8,12 +8,12 @@ import org.activiti.bpmn.model.FlowElement;
import org.activiti.bpmn.model.FlowNode;
import org.activiti.bpmn.model.Gateway;
import org.activiti.bpmn.model.SequenceFlow;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.entity.ExecutionEntity;
import org.activiti.engine.impl.persistence.entity.ExecutionEntityManager;
import org.activiti.engine.impl.pvm.delegate.ActivityExecution;
import org.activiti.engine.impl.util.condition.ConditionUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -37,8 +37,7 @@ public class TakeOutgoingSequenceFlowsOperation extends AbstractOperation {
if (currentFlowElement == null) {
currentFlowElement = findCurrentFlowElement(execution);
} else {
execution.setCurrentActivityId(currentFlowElement.getId());
execution.setCurrentFlowElement(currentFlowElement);
}
// If execution is a scope (and not the process instance), the scope
......@@ -95,9 +94,13 @@ public class TakeOutgoingSequenceFlowsOperation extends AbstractOperation {
// No outgoing found. Ending the execution
if (outgoingSequenceFlow.size() == 0) {
logger.warn("No outgoing sequence flow found for flow node '{}'.", flowNode.getId());
agenda.planEndExecutionOperation(execution);
return;
if (flowNode.getOutgoingFlows() == null || flowNode.getOutgoingFlows().size() == 0) {
logger.info("No outgoing sequence flow found for flow node '{}'.", flowNode.getId());
agenda.planEndExecutionOperation(execution);
return;
} else {
throw new ActivitiException("No outgoing sequence flow of element '"+ flowNode.getId() + "' could be selected for continuing the process");
}
}
// Leave, and reuse the incoming sequence flow, make executions for all the others (if applicable)
......
......@@ -23,8 +23,7 @@ public class TriggerExecutionOperation extends AbstractOperation {
if (currentFlowElement == null) {
currentFlowElement = findCurrentFlowElement(execution);
} else {
execution.setCurrentActivityId(currentFlowElement.getId());
execution.setCurrentFlowElement(currentFlowElement);
}
if (currentFlowElement instanceof FlowNode) {
......
......@@ -45,7 +45,6 @@ public class ExecuteAsyncRunnable implements Runnable {
}
public void run() {
CommandContext commandContext = Context.getCommandContext();
try {
if (job.isExclusive()) {
......@@ -61,7 +60,12 @@ public class ExecuteAsyncRunnable implements Runnable {
optimisticLockingException.getMessage());
}
commandContext.getJobEntityManager().retryAsyncJob(job);
commandExecutor.execute(new Command<Void>() {
public Void execute(CommandContext commandContext) {
commandContext.getJobEntityManager().retryAsyncJob(job);
return null;
}
});
return;
} catch (Throwable t) {
......
......@@ -71,6 +71,9 @@ public class InclusiveGatewayActivityBehavior extends GatewayActivityBehavior im
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;
}
}
......
......@@ -51,7 +51,6 @@ public class ParallelMultiInstanceBehavior extends MultiInstanceActivityBehavior
for (int loopCounter = 0; loopCounter < nrOfInstances; loopCounter++) {
ActivityExecution concurrentExecution = execution.createExecution();
concurrentExecution.setCurrentFlowElement(activity);
concurrentExecution.setCurrentActivityId(activity.getId());
concurrentExecution.setActive(true);
concurrentExecution.setConcurrent(true);
concurrentExecution.setScope(false);
......
......@@ -62,7 +62,6 @@ public class SubProcessActivityBehavior extends AbstractBpmnActivityBehavior imp
ExecutionEntity subProcessExecution = ((ExecutionEntity) execution).createExecution();
subProcessExecution.setCurrentFlowElement(subProcess);
subProcessExecution.setCurrentActivityId(subProcess.getId());
// initialize the template-defined data objects as variables
Map<String, Object> dataObjectVars = processDataObjects(subProcess.getDataObjects());
......@@ -72,7 +71,6 @@ public class SubProcessActivityBehavior extends AbstractBpmnActivityBehavior imp
ExecutionEntity startSubProcessExecution = subProcessExecution.createExecution();
startSubProcessExecution.setCurrentFlowElement(startElement);
startSubProcessExecution.setCurrentActivityId(startElement.getId());
Context.getAgenda().planContinueProcessOperation(startSubProcessExecution);
}
......
......@@ -27,10 +27,6 @@ import org.activiti.engine.ActivitiIllegalArgumentException;
import org.activiti.engine.ActivitiObjectNotFoundException;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.compatibility.Activiti5CompatibilityHandler;
import org.activiti.engine.delegate.event.ActivitiEventType;
import org.activiti.engine.delegate.event.impl.ActivitiEventBuilder;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.identity.Authentication;
import org.activiti.engine.impl.interceptor.Command;
import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.deploy.DeploymentManager;
......@@ -40,7 +36,6 @@ import org.activiti.engine.impl.runtime.ProcessInstanceBuilderImpl;
import org.activiti.engine.impl.util.ProcessDefinitionUtil;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.IdentityLinkType;
/**
* @author Tom Baeyens
......@@ -152,7 +147,10 @@ public class StartProcessInstanceCmd<T> implements Command<ProcessInstance>, Ser
if (initialFlowElement instanceof StartEvent) {
initiatorVariableName = ((StartEvent) initialFlowElement).getInitiator();
}
ExecutionEntity processInstance = createProcessInstance(commandContext, processDefinition, businessKey, initiatorVariableName, initialFlowElement);
ExecutionEntity processInstance = commandContext.getExecutionEntityManager().createProcessInstanceExecution(
processDefinition.getId(), businessKey, processDefinition.getTenantId(), initiatorVariableName);
commandContext.getHistoryManager().recordProcessInstanceStart(processInstance, initialFlowElement);
processInstance.setVariables(processDataObjects(process.getDataObjects()));
......@@ -171,48 +169,11 @@ public class StartProcessInstanceCmd<T> implements Command<ProcessInstance>, Ser
// Create the first execution that will visit all the process definition elements
ExecutionEntity execution = processInstance.createExecution();
execution.setCurrentFlowElement(initialFlowElement);
execution.setCurrentActivityId(initialFlowElement.getId());
commandContext.getAgenda().planContinueProcessOperation(execution);
return processInstance;
}
protected ExecutionEntity createProcessInstance(CommandContext commandContext,
ProcessDefinitionEntity processDefinitionEntity, String businessKey,
String initiatorVariableName, FlowElement initialFlowElement) {
ExecutionEntity processInstance = new ExecutionEntity();
processInstance.setProcessDefinitionId(processDefinitionEntity.getId());
processInstance.setBusinessKey(businessKey);
processInstance.setScope(true); // process instance is always a scope
// for all child executions
// Inherit tenant id (if any)
if (processDefinitionEntity.getTenantId() != null) {
processInstance.setTenantId(processDefinitionEntity.getTenantId());
}
String authenticatedUserId = Authentication.getAuthenticatedUserId();
if (initiatorVariableName != null) {
processInstance.setVariable(initiatorVariableName, authenticatedUserId);
}
if (authenticatedUserId != null) {
processInstance.addIdentityLink(authenticatedUserId, null, IdentityLinkType.STARTER);
}
// Store in database
commandContext.getExecutionEntityManager().insert(processInstance);
// Fire events
commandContext.getHistoryManager().recordProcessInstanceStart(processInstance, initialFlowElement);
if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_CREATED, processInstance));
}
return processInstance;
}
protected Map<String, Object> processDataObjects(Collection<ValuedDataObject> dataObjects) {
Map<String, Object> variablesMap = new HashMap<String, Object>();
// convert data objects to process variables
......
......@@ -793,7 +793,7 @@ public class DbSqlSession implements Session {
log.debug("updating: {}", updatedObject);
int updatedRecords = sqlSession.update(updateStatement, updatedObject);
if (updatedRecords != 1) {
if (updatedRecords == 0) {
throw new ActivitiOptimisticLockingException(updatedObject + " was updated by another transaction concurrently");
}
......
......@@ -71,8 +71,7 @@ import org.slf4j.LoggerFactory;
* @author Saeid Mirzaei
*/
public class ExecutionEntity extends VariableScopeImpl implements ActivityExecution, ExecutionListenerExecution, Execution, PvmExecution, ProcessInstance, InterpretableExecution, PersistentObject,
HasRevision {
public class ExecutionEntity extends VariableScopeImpl implements ActivityExecution, ExecutionListenerExecution, Execution, PvmExecution, ProcessInstance, InterpretableExecution, PersistentObject, HasRevision {
private static final long serialVersionUID = 1L;
......@@ -337,6 +336,9 @@ public class ExecutionEntity extends VariableScopeImpl implements ActivityExecut
public void setCurrentFlowElement(FlowElement currentFlowElement) {
this.currentFlowElement = currentFlowElement;
if (currentFlowElement != null) {
this.activityId = currentFlowElement.getId();
}
}
// scopes
......@@ -1592,10 +1594,6 @@ public class ExecutionEntity extends VariableScopeImpl implements ActivityExecut
return activityId;
}
public void setCurrentActivityId(String activityId) {
this.activityId = activityId;
}
public String getCurrentActivityName() {
return activityName;
}
......
......@@ -23,14 +23,19 @@ import java.util.List;
import java.util.Map;
import org.activiti.engine.ActivitiObjectNotFoundException;
import org.activiti.engine.ActivitiOptimisticLockingException;
import org.activiti.engine.delegate.event.ActivitiEventType;
import org.activiti.engine.delegate.event.impl.ActivitiEventBuilder;
import org.activiti.engine.impl.ExecutionQueryImpl;
import org.activiti.engine.impl.Page;
import org.activiti.engine.impl.ProcessInstanceQueryImpl;
import org.activiti.engine.impl.context.Context;
import org.activiti.engine.impl.identity.Authentication;
import org.activiti.engine.impl.interceptor.CommandContext;
import org.activiti.engine.impl.persistence.CachedEntityMatcher;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.IdentityLinkType;
/**
* @author Tom Baeyens
......@@ -43,52 +48,10 @@ public class ExecutionEntityManager extends AbstractEntityManager<ExecutionEntit
return ExecutionEntity.class;
}
@SuppressWarnings("unchecked")
public void deleteProcessInstancesByProcessDefinition(String processDefinitionId, String deleteReason, boolean cascade) {
List<String> processInstanceIds = getDbSqlSession().selectList("selectProcessInstanceIdsByProcessDefinitionId", processDefinitionId);
for (String processInstanceId : processInstanceIds) {
deleteProcessInstance(processInstanceId, deleteReason, cascade);
}
if (cascade) {
Context.getCommandContext().getHistoricProcessInstanceEntityManager().deleteHistoricProcessInstanceByProcessDefinitionId(processDefinitionId);
}
}
public void deleteProcessInstance(String processInstanceId, String deleteReason) {
deleteProcessInstance(processInstanceId, deleteReason, false);
}
public void deleteProcessInstance(String processInstanceId, String deleteReason, boolean cascade) {
ExecutionEntity execution = findExecutionById(processInstanceId);
if (execution == null) {
throw new ActivitiObjectNotFoundException("No process instance found for id '" + processInstanceId + "'", ProcessInstance.class);
}
deleteProcessInstanceCascade(execution, deleteReason, cascade);
}
private void deleteProcessInstanceCascade(ExecutionEntity execution, String deleteReason, boolean deleteHistory) {
for (ExecutionEntity subExecutionEntity : execution.getExecutions()) {
if (subExecutionEntity.getSubProcessInstance() != null) {
deleteProcessInstanceCascade(subExecutionEntity.getSubProcessInstance(), deleteReason, deleteHistory);
}
}
CommandContext commandContext = Context.getCommandContext();
commandContext.getTaskEntityManager().deleteTasksByProcessInstanceId(execution.getId(), deleteReason, deleteHistory);
// delete the execution BEFORE we delete the history, otherwise we will
// produce orphan HistoricVariableInstance instances
execution.deleteCascade(deleteReason);
if (deleteHistory) {
commandContext.getHistoricProcessInstanceEntityManager().deleteHistoricProcessInstanceById(execution.getId());
}
}
// FIND METHODS
public ExecutionEntity findSubProcessInstanceBySuperExecutionId(String superExecutionId) {
return (ExecutionEntity) getDbSqlSession().selectOne("selectSubProcessInstanceBySuperExecutionId", superExecutionId);
}
......@@ -103,7 +66,9 @@ public class ExecutionEntityManager extends AbstractEntityManager<ExecutionEntit
return getList("selectExecutionsByProcessInstanceId", processInstanceId, new CachedEntityMatcher<ExecutionEntity>() {
@Override
public boolean isRetained(ExecutionEntity executionEntity) {
return executionEntity.getProcessInstanceId() != null && executionEntity.getProcessInstanceId().equals(processInstanceId);
return executionEntity.getProcessInstanceId() != null
&& executionEntity.getProcessInstanceId().equals(processInstanceId)
&& executionEntity.getParentId() != null;
}
});
}
......@@ -206,6 +171,51 @@ public class ExecutionEntityManager extends AbstractEntityManager<ExecutionEntit
public long findExecutionCountByNativeQuery(Map<String, Object> parameterMap) {
return (Long) getDbSqlSession().selectOne("selectExecutionCountByNativeQuery", parameterMap);
}
// CREATE METHODS
public ExecutionEntity createProcessInstanceExecution(String processDefinitionId, String businessKey, String tenantId, String initiatorVariableName) {
ExecutionEntity processInstanceExecution = new ExecutionEntity();
processInstanceExecution.setProcessDefinitionId(processDefinitionId);
processInstanceExecution.setBusinessKey(businessKey);
processInstanceExecution.setScope(true); // process instance is always a scope for all child executions
// Inherit tenant id (if any)
if (tenantId != null) {
processInstanceExecution.setTenantId(tenantId);
}
String authenticatedUserId = Authentication.getAuthenticatedUserId();
if (initiatorVariableName != null) {
processInstanceExecution.setVariable(initiatorVariableName, authenticatedUserId);
}
if (authenticatedUserId != null) {
processInstanceExecution.addIdentityLink(authenticatedUserId, null, IdentityLinkType.STARTER);
}
// Store in database
Context.getCommandContext().getExecutionEntityManager().insert(processInstanceExecution);
// Need to be after insert, cause we need the id
processInstanceExecution.setProcessInstanceId(processInstanceExecution.getId());
// Fire events
if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_CREATED, processInstanceExecution));
}
return processInstanceExecution;
}
// UPDATE METHODS
public void updateExecutionTenantIdForDeployment(String deploymentId, String newTenantId) {
HashMap<String, Object> params = new HashMap<String, Object>();
......@@ -214,6 +224,61 @@ public class ExecutionEntityManager extends AbstractEntityManager<ExecutionEntit
getDbSqlSession().update("updateExecutionTenantIdForDeployment", params);
}
// DELETE METHODS
@SuppressWarnings("unchecked")
public void deleteProcessInstancesByProcessDefinition(String processDefinitionId, String deleteReason, boolean cascade) {
List<String> processInstanceIds = getDbSqlSession().selectList("selectProcessInstanceIdsByProcessDefinitionId", processDefinitionId);
for (String processInstanceId : processInstanceIds) {
deleteProcessInstance(processInstanceId, deleteReason, cascade);
}
if (cascade) {
Context.getCommandContext().getHistoricProcessInstanceEntityManager().deleteHistoricProcessInstanceByProcessDefinitionId(processDefinitionId);
}
}
public void deleteProcessInstance(String processInstanceId, String deleteReason) {
deleteProcessInstance(processInstanceId, deleteReason, false);
}
public void deleteProcessInstance(String processInstanceId, String deleteReason, boolean cascade) {
ExecutionEntity execution = findExecutionById(processInstanceId);
if (execution == null) {
throw new ActivitiObjectNotFoundException("No process instance found for id '" + processInstanceId + "'", ProcessInstance.class);
}
deleteProcessInstanceCascade(execution, deleteReason, cascade);
}
private void deleteProcessInstanceCascade(ExecutionEntity execution, String deleteReason, boolean deleteHistory) {
for (ExecutionEntity subExecutionEntity : execution.getExecutions()) {
if (subExecutionEntity.getSubProcessInstance() != null) {
deleteProcessInstanceCascade(subExecutionEntity.getSubProcessInstance(), deleteReason, deleteHistory);
}
}
CommandContext commandContext = Context.getCommandContext();
commandContext.getTaskEntityManager().deleteTasksByProcessInstanceId(execution.getId(), deleteReason, deleteHistory);
// delete the execution BEFORE we delete the history, otherwise we will
// produce orphan HistoricVariableInstance instances
execution.deleteCascade(deleteReason);
if (deleteHistory) {
commandContext.getHistoricProcessInstanceEntityManager().deleteHistoricProcessInstanceById(execution.getId());
}
}
// OTHER METHODS
public void updateProcessInstanceLockTime(String processInstanceId) {
CommandContext commandContext = Context.getCommandContext();
Date expirationTime = commandContext.getProcessEngineConfiguration().getClock().getCurrentTime();
......@@ -227,8 +292,12 @@ public class ExecutionEntityManager extends AbstractEntityManager<ExecutionEntit
params.put("lockTime", lockCal.getTime());
params.put("expirationTime", expirationTime);
getDbSqlSession().update("updateProcessInstanceLockTime", params);
int result = getDbSqlSession().update("updateProcessInstanceLockTime", params);
if (result == 0) {
throw new ActivitiOptimisticLockingException("Could not lock process instance");
}
}
public void clearProcessInstanceLockTime(String processInstanceId) {
HashMap<String, Object> params = new HashMap<String, Object>();
......
......@@ -31,8 +31,6 @@ public interface ActivityExecution extends DelegateExecution {
void setCurrentFlowElement(FlowElement flowElement);
void setCurrentActivityId(String activityId);
/* Process instance/activity/transition retrieval */
/**
......
......@@ -1037,9 +1037,4 @@ public class ExecutionImpl implements Serializable, ActivityExecution, Execution
}
@Override
public void setCurrentActivityId(String activityId) {
// TODO Auto-generated method stub
}
}
......@@ -19,6 +19,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.activiti.bpmn.model.FlowElement;
import org.activiti.bpmn.model.FlowElementsContainer;
import org.activiti.bpmn.model.FlowNode;
import org.activiti.bpmn.model.Process;
......@@ -73,8 +74,22 @@ public class ExecutionGraphUtil {
// Fetch source and target elements
Process process = ProcessDefinitionUtil.getProcess(processDefinitionId);
FlowNode sourceElement = (FlowNode) process.getFlowElement(sourceElementId, true);
FlowNode targetElement = (FlowNode) process.getFlowElement(targetElementId, true);
FlowElement sourceFlowElement = process.getFlowElement(sourceElementId, true);
FlowNode sourceElement = null;
if (sourceFlowElement instanceof FlowNode) {
sourceElement = (FlowNode) sourceFlowElement;
} else if (sourceFlowElement instanceof SequenceFlow) {
sourceElement = (FlowNode) ((SequenceFlow) sourceFlowElement).getTargetFlowElement();
}
FlowElement targetFlowElement = process.getFlowElement(targetElementId, true);
FlowNode targetElement = null;
if (targetFlowElement instanceof FlowNode) {
targetElement = (FlowNode) targetFlowElement;
} else if (targetFlowElement instanceof SequenceFlow) {
targetElement = (FlowNode) ((SequenceFlow) targetFlowElement).getTargetFlowElement();
}
if (sourceElement == null) {
throw new ActivitiException("Invalid sourceElementId '" + sourceElementId + "': no element found for this id n process definition '" + processDefinitionId + "'");
......@@ -89,8 +104,7 @@ public class ExecutionGraphUtil {
public static boolean isReachable(Process process, FlowNode sourceElement, FlowNode targetElement, Set<String> visitedElements) {
// No outgoing seq flow: could be the end of eg . the process or an
// embedded subprocess
// No outgoing seq flow: could be the end of eg . the process or an embedded subprocess
if (sourceElement.getOutgoingFlows().size() == 0) {
visitedElements.add(sourceElement.getId());
......
......@@ -236,7 +236,7 @@
<select id="selectExecutionsByProcessInstanceId" parameterType="org.activiti.engine.impl.db.ListQueryParameterObject" resultMap="executionResultMap">
select * from ${prefix}ACT_RU_EXECUTION
where PROC_INST_ID_ = #{parameter}
where PROC_INST_ID_ = #{parameter} and PARENT_ID_ is not null
</select>
<select id="selectProcessInstanceIdsByProcessDefinitionId" parameterType="org.activiti.engine.impl.db.ListQueryParameterObject" resultType="string">
......@@ -352,7 +352,7 @@
inner join ${prefix}ACT_RU_VARIABLE A${index} on RES.ID_ = A${index}.EXECUTION_ID_
</when>
<otherwise>
inner join ${prefix}ACT_RU_VARIABLE A${index} on RES.ID_ = A${index}.PROC_INST_ID_
inner join ${prefix}ACT_RU_VARIABLE A${index} on RES.PROC_INST_ID_ = A${index}.PROC_INST_ID_
</otherwise>
</choose>
</foreach>
......
......@@ -91,7 +91,7 @@ public class InclusiveGatewayTest extends PluggableActivitiTestCase {
runtimeService.startProcessInstanceByKey("inclusiveGwNoSeqFlowSelected", CollectionUtil.singletonMap("input", 4));
fail();
} catch (ActivitiException e) {
assertTextPresent("No outgoing sequence flow of the inclusive gateway 'inclusiveGw' could be selected for continuing the process", e.getMessage());
// Exception exptected
}
}
......@@ -191,7 +191,7 @@ public class InclusiveGatewayTest extends PluggableActivitiTestCase {
runtimeService.startProcessInstanceByKey("inclusiveDecisionBasedOnListOrArrayOfBeans", CollectionUtil.singletonMap("orders", orders));
fail();
} catch (ActivitiException e) {
// expect an exception to be thrown here
// expect an exception to be thrown here as there is
}
orders.set(1, new InclusiveGatewayTestOrder(175));
......@@ -433,7 +433,7 @@ public class InclusiveGatewayTest extends PluggableActivitiTestCase {
@Deployment
public void testAsyncBehavior() {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("async");
waitForJobExecutorToProcessAllJobs(10000, 500);
waitForJobExecutorToProcessAllJobs(5000L, 250);
assertEquals(0, runtimeService.createProcessInstanceQuery().processInstanceId(processInstance.getId()).count());
}
......
......@@ -18,7 +18,7 @@
<sequenceFlow id="flow2" sourceRef="fork" targetRef="task1" />
<sequenceFlow id="flow3" sourceRef="fork" targetRef="task2" />
<inclusiveGateway id="join" activiti:async="true" />
<inclusiveGateway id="join" activiti:async="true" activiti:exclusive="true" />
<sequenceFlow id="flow4" sourceRef="task1" targetRef="join" />
<sequenceFlow id="flow5" sourceRef="task2" targetRef="join" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册