本文整理汇总了Java中org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.setEventScope方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionEntity.setEventScope方法的具体用法?Java ExecutionEntity.setEventScope怎么用?Java ExecutionEntity.setEventScope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity
的用法示例。
在下文中一共展示了ExecutionEntity.setEventScope方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
public ExecutionEntity read(GettableData data) {
ExecutionEntity executionEntity = new ExecutionEntity();
executionEntity.setId(data.getString("id"));
executionEntity.setProcessInstanceId(data.getString("proc_inst_id"));
executionEntity.setParentId(data.getString("parent_id"));
executionEntity.setProcessDefinitionId(data.getString("proc_def_id"));
executionEntity.setSuperExecutionId(data.getString("super_exec"));
executionEntity.setSuperCaseExecutionId(data.getString("super_case_exec"));
executionEntity.setCaseInstanceId(data.getString("case_inst_id"));
executionEntity.setActivityInstanceId(data.getString("act_inst_id"));
executionEntity.setActivityId(data.getString("act_id"));
executionEntity.setActive(data.getBool("is_active"));
executionEntity.setConcurrent(data.getBool("is_concurrent"));
executionEntity.setScope(data.getBool("is_scope"));
executionEntity.setEventScope(data.getBool("is_event_scope"));
executionEntity.setSuspensionState(data.getInt("suspension_state"));
executionEntity.setCachedEntityState(data.getInt("cached_ent_state"));
executionEntity.setSequenceCounter(data.getLong("sequence_counter"));
return executionEntity;
}
示例2: instantiateScopes
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
@Override
protected void instantiateScopes(
MigratingScopeInstance ancestorScopeInstance,
MigratingScopeInstanceBranch executionBranch,
List<ScopeImpl> scopesToInstantiate) {
if (scopesToInstantiate.isEmpty()) {
return;
}
ExecutionEntity ancestorScopeExecution = ancestorScopeInstance.resolveRepresentativeExecution();
ExecutionEntity parentExecution = ancestorScopeExecution;
for (ScopeImpl scope : scopesToInstantiate) {
ExecutionEntity compensationScopeExecution = parentExecution.createExecution();
compensationScopeExecution.setScope(true);
compensationScopeExecution.setEventScope(true);
compensationScopeExecution.setActivity((PvmActivity) scope);
compensationScopeExecution.setActive(false);
compensationScopeExecution.activityInstanceStarting();
compensationScopeExecution.enterActivityInstance();
EventSubscriptionEntity eventSubscription = EventSubscriptionEntity.createAndInsert(parentExecution, EventType.COMPENSATE, (ActivityImpl) scope);
eventSubscription.setConfiguration(compensationScopeExecution.getId());
executionBranch.visited(new MigratingEventScopeInstance(eventSubscription, compensationScopeExecution, scope));
parentExecution = compensationScopeExecution;
}
}
示例3: createEventScopeExecution
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
/**
* creates an event scope for the given execution:
*
* create a new event scope execution under the parent of the given execution
* and move all event subscriptions to that execution.
*
* this allows us to "remember" the event subscriptions after finishing a
* scope
*/
public static void createEventScopeExecution(ExecutionEntity execution) {
// parent execution is a subprocess or a miBody
ActivityImpl activity = execution.getActivity();
ExecutionEntity scopeExecution = (ExecutionEntity) execution.findExecutionForFlowScope(activity.getFlowScope());
List<EventSubscriptionEntity> eventSubscriptions = execution.getCompensateEventSubscriptions();
if (eventSubscriptions.size() > 0 || hasCompensationEventSubprocess(activity)) {
ExecutionEntity eventScopeExecution = scopeExecution.createExecution();
eventScopeExecution.setActivity(execution.getActivity());
eventScopeExecution.activityInstanceStarting();
eventScopeExecution.enterActivityInstance();
eventScopeExecution.setActive(false);
eventScopeExecution.setConcurrent(false);
eventScopeExecution.setEventScope(true);
// copy local variables to eventScopeExecution by value. This way,
// the eventScopeExecution references a 'snapshot' of the local variables
Map<String, Object> variables = execution.getVariablesLocal();
for (Entry<String, Object> variable : variables.entrySet()) {
eventScopeExecution.setVariableLocal(variable.getKey(), variable.getValue());
}
// set event subscriptions to the event scope execution:
for (EventSubscriptionEntity eventSubscriptionEntity : eventSubscriptions) {
EventSubscriptionEntity newSubscription =
EventSubscriptionEntity.createAndInsert(
eventScopeExecution,
EventType.COMPENSATE,
eventSubscriptionEntity.getActivity());
newSubscription.setConfiguration(eventSubscriptionEntity.getConfiguration());
// use the original date
newSubscription.setCreated(eventSubscriptionEntity.getCreated());
}
// set existing event scope executions as children of new event scope execution
// (ensuring they don't get removed when 'execution' gets removed)
for (PvmExecutionImpl childEventScopeExecution : execution.getEventScopeExecutions()) {
childEventScopeExecution.setParent(eventScopeExecution);
}
ActivityImpl compensationHandler = getEventScopeCompensationHandler(execution);
EventSubscriptionEntity eventSubscription = EventSubscriptionEntity
.createAndInsert(
scopeExecution,
EventType.COMPENSATE,
compensationHandler
);
eventSubscription.setConfiguration(eventScopeExecution.getId());
}
}