当前位置: 首页>>代码示例>>Java>>正文


Java CaseExecutionEntity类代码示例

本文整理汇总了Java中org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity的典型用法代码示例。如果您正苦于以下问题:Java CaseExecutionEntity类的具体用法?Java CaseExecutionEntity怎么用?Java CaseExecutionEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CaseExecutionEntity类属于org.camunda.bpm.engine.impl.cmmn.entity.runtime包,在下文中一共展示了CaseExecutionEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: performOperation

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
public void performOperation(final CmmnAtomicOperation executionOperation, final CaseExecutionEntity execution) {
  ProcessApplicationReference targetProcessApplication = getTargetProcessApplication(execution);

  if(requiresContextSwitch(targetProcessApplication)) {
    Context.executeWithinProcessApplication(new Callable<Void>() {
      public Void call() throws Exception {
        performOperation(executionOperation, execution);
        return null;
      }

    }, targetProcessApplication, new InvocationContext(execution));

  } else {
    try {
      Context.setExecutionContext(execution);
      LOG.debugExecutingAtomicOperation(executionOperation, execution);

      executionOperation.execute(execution);
    } finally {
      Context.removeExecutionContext();
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:CommandContext.java

示例2: execute

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
public VariableMap execute(CommandContext commandContext) {
  ensureNotNull("caseExecutionId", caseExecutionId);

  CaseExecutionEntity caseExecution = commandContext
    .getCaseExecutionManager()
    .findCaseExecutionById(caseExecutionId);

  ensureNotNull(CaseExecutionNotFoundException.class, "case execution " + caseExecutionId + " doesn't exist", "caseExecution", caseExecution);

  for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
    checker.checkReadCaseInstance(caseExecution);
  }

  VariableMapImpl result = new VariableMapImpl();
  // collect variables
  caseExecution.collectVariables(result, variableNames, isLocal, deserializeValues);

  return result;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:GetCaseExecutionVariablesCmd.java

示例3: execute

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
public TypedValue execute(CommandContext commandContext) {
  ensureNotNull("caseExecutionId", caseExecutionId);
  ensureNotNull("variableName", variableName);

  CaseExecutionEntity caseExecution = commandContext
    .getCaseExecutionManager()
    .findCaseExecutionById(caseExecutionId);

  ensureNotNull(CaseExecutionNotFoundException.class, "case execution " + caseExecutionId + " doesn't exist", "caseExecution", caseExecution);

  for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
    checker.checkReadCaseInstance(caseExecution);
  }

  TypedValue value;

  if (isLocal) {
    value = caseExecution.getVariableLocalTyped(variableName, deserializeValue);
  } else {
    value = caseExecution.getVariableTyped(variableName, deserializeValue);
  }

  return value;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:GetCaseExecutionVariableTypedCmd.java

示例4: execute

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
public Object execute(CommandContext commandContext) {
  ensureNotNull("caseExecutionId", caseExecutionId);
  ensureNotNull("variableName", variableName);

  CaseExecutionEntity caseExecution = commandContext
    .getCaseExecutionManager()
    .findCaseExecutionById(caseExecutionId);

  ensureNotNull(CaseExecutionNotFoundException.class, "case execution " + caseExecutionId + " doesn't exist", "caseExecution", caseExecution);

  for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
    checker.checkReadCaseInstance(caseExecution);
  }

  Object value;

  if (isLocal) {
    value = caseExecution.getVariableLocal(variableName);
  } else {
    value = caseExecution.getVariable(variableName);
  }

  return value;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:GetCaseExecutionVariableCmd.java

示例5: createAndInsert

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
/** creates and initializes a new persistent task. */
public static TaskEntity createAndInsert(VariableScope execution) {
  TaskEntity task = create();

  if (execution instanceof ExecutionEntity) {
    ExecutionEntity executionEntity = (ExecutionEntity) execution;
    task.setExecution(executionEntity);
    task.skipCustomListeners = executionEntity.isSkipCustomListeners();
    task.insert(executionEntity);
    return task;

  }
  else if (execution instanceof CaseExecutionEntity) {
    task.setCaseExecution((DelegateCaseExecution) execution);
  }

  task.insert(null);
  return task;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:TaskEntity.java

示例6: createSubCaseInstance

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
@Override
public CaseExecutionEntity createSubCaseInstance(CmmnCaseDefinition caseDefinition, String businessKey) {
  CaseExecutionEntity subCaseInstance = (CaseExecutionEntity) caseDefinition.createCaseInstance(businessKey);

  // inherit the tenant-id from the case definition
  String tenantId = ((CaseDefinitionEntity) caseDefinition).getTenantId();
  if (tenantId != null) {
    subCaseInstance.setTenantId(tenantId);
  }
  else {
    // if case definition has no tenant id, inherit this process instance's tenant id
    subCaseInstance.setTenantId(this.tenantId);
  }

  // manage bidirectional super-process-sub-case-instances relation
  subCaseInstance.setSuperExecution(this);
  setSubCaseInstance(subCaseInstance);

  fireHistoricActivityInstanceUpdate();

  return subCaseInstance;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:ExecutionEntity.java

示例7: createDecisionEvaluatedEvt

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
protected HistoricDecisionInstanceEntity createDecisionEvaluatedEvt(DmnDecisionLogicEvaluationEvent evaluationEvent, CaseExecutionEntity execution) {
  // create event instance
  HistoricDecisionInstanceEntity event = newDecisionInstanceEventEntity(execution, evaluationEvent);
  // initialize event
  initDecisionInstanceEvent(event, evaluationEvent, HistoryEventTypes.DMN_DECISION_EVALUATE);
  setReferenceToCaseInstance(event, execution);
  // set current time as evaluation time
  event.setEvaluationTime(ClockUtil.getCurrentTime());

  DecisionDefinition decisionDefinition = (DecisionDefinition) evaluationEvent.getDecision();
  String tenantId = execution.getTenantId();
  if (tenantId == null) {
    tenantId = provideTenantId(decisionDefinition, event);
  }
  event.setTenantId(tenantId);
  return event;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:DefaultDmnHistoryEventProducer.java

示例8: createCaseInstanceCloseEvt

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
public HistoryEvent createCaseInstanceCloseEvt(DelegateCaseExecution caseExecution) {
  final CaseExecutionEntity caseExecutionEntity = (CaseExecutionEntity) caseExecution;

  // create event instance
  HistoricCaseInstanceEventEntity evt = loadCaseInstanceEventEntity(caseExecutionEntity);

  // initialize event
  initCaseInstanceEvent(evt, caseExecutionEntity, HistoryEventTypes.CASE_INSTANCE_CLOSE);

  // set end time
  evt.setEndTime(ClockUtil.getCurrentTime());

  if (evt.getStartTime() != null) {
    evt.setDurationInMillis(evt.getEndTime().getTime() - evt.getStartTime().getTime());
  }

  return evt;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:DefaultCmmnHistoryEventProducer.java

示例9: createCaseActivityInstanceUpdateEvt

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
public HistoryEvent createCaseActivityInstanceUpdateEvt(DelegateCaseExecution caseExecution) {
  final CaseExecutionEntity caseExecutionEntity = (CaseExecutionEntity) caseExecution;

  // create event instance
  HistoricCaseActivityInstanceEventEntity evt = loadCaseActivityInstanceEventEntity(caseExecutionEntity);

  // initialize event
  initCaseActivityInstanceEvent(evt, caseExecutionEntity, HistoryEventTypes.CASE_ACTIVITY_INSTANCE_UPDATE);

  if (caseExecutionEntity.getTask() != null) {
    evt.setTaskId(caseExecutionEntity.getTask().getId());
  }

  if (caseExecutionEntity.getSubProcessInstance() != null) {
    evt.setCalledProcessInstanceId(caseExecutionEntity.getSubProcessInstance().getId());
  }

  if (caseExecutionEntity.getSubCaseInstance() != null) {
    evt.setCalledCaseInstanceId(caseExecutionEntity.getSubCaseInstance().getId());
  }

  return evt;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:DefaultCmmnHistoryEventProducer.java

示例10: createCaseActivityInstanceEndEvt

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
public HistoryEvent createCaseActivityInstanceEndEvt(DelegateCaseExecution caseExecution) {
  final CaseExecutionEntity caseExecutionEntity = (CaseExecutionEntity) caseExecution;

  // create event instance
  HistoricCaseActivityInstanceEventEntity evt = loadCaseActivityInstanceEventEntity(caseExecutionEntity);

  // initialize event
  initCaseActivityInstanceEvent(evt, caseExecutionEntity, HistoryEventTypes.CASE_ACTIVITY_INSTANCE_END);

  // set end time
  evt.setEndTime(ClockUtil.getCurrentTime());

  // calculate duration
  if (evt.getStartTime() != null) {
    evt.setDurationInMillis(evt.getEndTime().getTime() - evt.getStartTime().getTime());
  }

  return evt;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:DefaultCmmnHistoryEventProducer.java

示例11: initCaseActivityInstanceEvent

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
protected void initCaseActivityInstanceEvent(HistoricCaseActivityInstanceEventEntity evt, CaseExecutionEntity caseExecutionEntity, HistoryEventTypes eventType) {
  evt.setId(caseExecutionEntity.getId());
  evt.setParentCaseActivityInstanceId(caseExecutionEntity.getParentId());
  evt.setEventType(eventType.getEventName());
  evt.setCaseDefinitionId(caseExecutionEntity.getCaseDefinitionId());
  evt.setCaseInstanceId(caseExecutionEntity.getCaseInstanceId());
  evt.setCaseExecutionId(caseExecutionEntity.getId());
  evt.setCaseActivityInstanceState(caseExecutionEntity.getState());

  evt.setRequired(caseExecutionEntity.isRequired());

  evt.setCaseActivityId(caseExecutionEntity.getActivityId());
  evt.setCaseActivityName(caseExecutionEntity.getActivityName());
  evt.setCaseActivityType(caseExecutionEntity.getActivityType());

  evt.setTenantId(caseExecutionEntity.getTenantId());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:DefaultCmmnHistoryEventProducer.java

示例12: createHistoryEvent

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
protected HistoryEvent createHistoryEvent(DmnDecisionEvaluationEvent evaluationEvent) {
  DmnDecision decisionTable = evaluationEvent.getDecisionResult().getDecision();
  if(isDeployedDecisionTable(decisionTable) && historyLevel.isHistoryEventProduced(HistoryEventTypes.DMN_DECISION_EVALUATE, decisionTable)) {

    CoreExecutionContext<? extends CoreExecution> executionContext = Context.getCoreExecutionContext();
    if (executionContext != null) {
      CoreExecution coreExecution = executionContext.getExecution();

      if (coreExecution instanceof ExecutionEntity) {
        ExecutionEntity execution = (ExecutionEntity) coreExecution;
        return eventProducer.createDecisionEvaluatedEvt(execution, evaluationEvent);
      }
      else if (coreExecution instanceof CaseExecutionEntity) {
        CaseExecutionEntity caseExecution = (CaseExecutionEntity) coreExecution;
        return eventProducer.createDecisionEvaluatedEvt(caseExecution, evaluationEvent);
      }

    }

    return eventProducer.createDecisionEvaluatedEvt(evaluationEvent);

  } else {
    return null;
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:26,代码来源:HistoryDecisionEvaluationListener.java

示例13: testCallCaseAsExpressionStartsWithDollar

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
@Deployment(resources = {
    "org/camunda/bpm/engine/test/bpmn/callactivity/CaseCallActivityTest.testCallCaseAsExpressionStartsWithDollar.bpmn20.xml",
    "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn"
  })
public void testCallCaseAsExpressionStartsWithDollar() {
  // given
  // a deployed process definition and case definition

  // when
  String superProcessInstanceId = startProcessInstanceByKey(PROCESS_DEFINITION_KEY, Variables.createVariables().putValue(ONE_TASK_CASE, ONE_TASK_CASE)).getId();

  // then
  String callActivityId = queryExecutionByActivityId(CALL_ACTIVITY_ID).getId();

  CaseExecutionEntity subCaseInstance = (CaseExecutionEntity) queryOneTaskCaseInstance();
  assertNotNull(subCaseInstance);

  assertEquals(callActivityId, subCaseInstance.getSuperExecutionId());

  // complete
  String humanTaskId = queryCaseExecutionByActivityId(HUMAN_TASK_ID).getId();

  complete(humanTaskId);
  close(subCaseInstance.getId());
  assertProcessEnded(superProcessInstanceId);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:CaseCallActivityTest.java

示例14: testCallCaseWithCompositeExpression

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
@Deployment(resources = {
  "org/camunda/bpm/engine/test/bpmn/callactivity/CaseCallActivityTest.testCallCaseWithCompositeExpression.bpmn20.xml",
  "org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn"
})
public void testCallCaseWithCompositeExpression() {
  // given
  // a deployed process definition and case definition

  // when
  String superProcessInstanceId = startProcessInstanceByKey(PROCESS_DEFINITION_KEY).getId();

  // then
  String callActivityId = queryExecutionByActivityId(CALL_ACTIVITY_ID).getId();

  CaseExecutionEntity subCaseInstance = (CaseExecutionEntity) queryOneTaskCaseInstance();
  assertNotNull(subCaseInstance);

  assertEquals(callActivityId, subCaseInstance.getSuperExecutionId());

  // complete
  String humanTaskId = queryCaseExecutionByActivityId(HUMAN_TASK_ID).getId();

  complete(humanTaskId);
  close(subCaseInstance.getId());
  assertProcessEnded(superProcessInstanceId);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:CaseCallActivityTest.java

示例15: produceCaseInstanceHistoryEventsForOneCaseInstance

import org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity; //导入依赖的package包/类
private void produceCaseInstanceHistoryEventsForOneCaseInstance(@NonNull final String caseInstanceId) {
    log.info(String.format("Creating history event for case instance '%s'", caseInstanceId));

    final CaseExecutionEntity caseInstance = (CaseExecutionEntity) caseService.createCaseInstanceQuery().caseInstanceId(caseInstanceId).singleResult();

    if (caseInstance == null) {
        throw new IllegalStateException(String.format("Case instance '%s' not found", caseInstanceId));
    }

    if (getHistoryLevel().isHistoryEventProduced(HistoryEventTypes.CASE_INSTANCE_UPDATE, null)) {
        final HistoryEvent event = new DefaultCmmnHistoryEventProducer().createCaseInstanceUpdateEvt(caseInstance);
        getHistoryEventHandler().handleEvent(event);
    }
}
 
开发者ID:holisticon,项目名称:holunda,代码行数:15,代码来源:CaseInstanceMigrator.java


注:本文中的org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。