• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ExecutionEntity类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: insert

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public void insert(CassandraPersistenceSession session, ExecutionEntity entity) {
  
  Session s = session.getSession();
  
  if(entity.isProcessInstanceExecution()) {
    session.addStatement(s.prepare(INSERT).bind(
        entity.getId(),
        entity.getRevision(),
        entity.getBusinessKey()));
  }
  
  session.addStatement(createUpdateStatement(session, entity));

  for(IndexHandler<ExecutionEntity> index:indexHandlers.values()){
    session.addStatement(index.getInsertStatement(session,entity));    
  }
}
 
开发者ID:camunda,项目名称:camunda-engine-cassandra,代码行数:18,代码来源:ExecutionEntityOperations.java


示例2: delete

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public void delete(CassandraPersistenceSession session, ExecutionEntity entity) {
  
  if(entity.isProcessInstanceExecution()) {
    session.addStatement(QueryBuilder.delete().all()
        .from(ProcessInstanceTableHandler.TABLE_NAME).where(eq("id", entity.getProcessInstanceId()))
        .onlyIf(eq("version", entity.getRevision())),
        entity.getProcessInstanceId());
    session.batchShouldNotLock(entity.getProcessInstanceId());
  }
  else {
    session.addStatement(QueryBuilder.delete().mapElt("executions", entity.getId())
        .from(ProcessInstanceTableHandler.TABLE_NAME).where(eq("id", entity.getProcessInstanceId())),
        entity.getProcessInstanceId());
  }
  
  for(IndexHandler<ExecutionEntity> index:indexHandlers.values()){
    session.addIndexStatement(index.getDeleteStatement(session,entity), entity.getProcessInstanceId());    
  }
}
 
开发者ID:camunda,项目名称:camunda-engine-cassandra,代码行数:20,代码来源:ExecutionEntityOperations.java


示例3: filter

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
/**
 * This method should filter the result map by everything in the query 
 * except process instance id, execution id and process business key
 * Right now only filters by variables and event subscriptions
 */
protected List<ExecutionEntity> filter(Map<String, ExecutionEntity> resultMap, CassandraPersistenceSession session, ExecutionQueryImpl executionQuery){
  if(resultMap.isEmpty()){
    throw new IllegalArgumentException("Do not filter empty resultMap.");
  }
  if(executionQuery.getQueryVariableValues() != null && !executionQuery.getQueryVariableValues().isEmpty()) {
    filterByVariables(executionQuery.getQueryVariableValues(), resultMap, session);
  }
  if(executionQuery.getEventSubscriptions() != null && !executionQuery.getEventSubscriptions().isEmpty()) {
    filterByEventSubscriptions(executionQuery.getEventSubscriptions(), resultMap, session);
  }
  if(resultMap.isEmpty()){
    return Collections.emptyList();
  }
  else{
    return new ArrayList<ExecutionEntity>(resultMap.values());        
  }
}
 
开发者ID:camunda,项目名称:camunda-engine-cassandra,代码行数:23,代码来源:SelectExecutionsByQueryCriteria.java


示例4: filterByEventSubscriptions

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
protected void filterByEventSubscriptions(List<EventSubscriptionQueryValue> eventSubscriptions, Map<String, ExecutionEntity> resultMap, CassandraPersistenceSession session) {
  Set<String> filteredExecutionIds = new HashSet<String>();

  for(ExecutionEntity executionEntity : resultMap.values() ){
    for (EventSubscriptionQueryValue queriedEventSubscription : eventSubscriptions) {
      boolean found=false;
      for(EventSubscriptionEntity eventSubscriptionEntity : executionEntity.getEventSubscriptions()) {
        if(queriedEventSubscription.getEventType().equals(eventSubscriptionEntity.getEventType()) &&
            (queriedEventSubscription.getEventName()==null || queriedEventSubscription.getEventName().equals(eventSubscriptionEntity.getEventName()))) {
          found=true;
          break;
        }
      }
      if(!found){
        filteredExecutionIds.add(executionEntity.getId());
        break;
      }
    }
  }
  
  for (String filteredExecution : filteredExecutionIds) {
    resultMap.remove(filteredExecution);
  }
}
 
开发者ID:camunda,项目名称:camunda-engine-cassandra,代码行数:25,代码来源:SelectExecutionsByQueryCriteria.java


示例5: executeQuery

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
@Override
public List<EventSubscriptionEntity> executeQuery(CassandraPersistenceSession session, ListQueryParameterObject parameter) {
  @SuppressWarnings("unchecked")
  Map<String, String> map=((Map<String, String>)parameter.getParameter());
  List<EventSubscriptionEntity> result=new ArrayList<EventSubscriptionEntity>();
  ExecutionEntity entity=session.selectById(ExecutionEntity.class, map.get("executionId"));
  if(entity==null){
    return result;
  }
  for(EventSubscriptionEntity eventSubscriptionEntity:entity.getEventSubscriptions()){
    if(eventSubscriptionEntity.getEventType().equals(map.get("eventType"))){
      result.add(eventSubscriptionEntity);
    }
  }
  return result;
}
 
开发者ID:camunda,项目名称:camunda-engine-cassandra,代码行数:17,代码来源:SelectEventSubscriptionsByExecutionAndType.java


示例6: write

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public void write(SettableData<?> data, ExecutionEntity entity) {
  data.setString("id", entity.getId())
  .setString("proc_inst_id", entity.getProcessInstanceId())
  .setString("parent_id", entity.getParentId())
  .setString("proc_def_id", entity.getProcessDefinitionId())
  .setString("super_exec", entity.getSuperExecutionId())
  .setString("super_case_exec", entity.getSuperCaseExecutionId())
  .setString("case_inst_id", entity.getCaseInstanceId())
  .setString("act_inst_id", entity.getActivityInstanceId())
  .setString("act_id", entity.getActivityId())
  .setBool("is_active", entity.isActive())
  .setBool("is_concurrent", entity.isConcurrent())
  .setBool("is_scope", entity.isScope())
  .setBool("is_event_scope", entity.isEventScope())
  .setInt("suspension_state", entity.getSuspensionState())
  .setInt("cached_ent_state", entity.getCachedEntityState())
  .setLong("sequence_counter", entity.getSequenceCounter());
}
 
开发者ID:camunda,项目名称:camunda-engine-cassandra,代码行数:19,代码来源:ExecutionEntitySerializer.java


示例7: 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;
}
 
开发者ID:camunda,项目名称:camunda-engine-cassandra,代码行数:22,代码来源:ExecutionEntitySerializer.java


示例8: evaluate

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public boolean evaluate(ExecutionEntity executionEntity) {
  if (script == null) {
    return true;
  }

  Context.getProcessEngineConfiguration().getScriptFactory();

  ExecutableScript executableScript = Context.getProcessEngineConfiguration()
      .getScriptFactory()
      .createScriptFromSource(scriptingLanguage, script);

  Object result = Context.getProcessEngineConfiguration()
      .getScriptingEnvironment()
      .execute(executableScript, executionEntity);

  if (result == null) {
    throw new DebuggerException("Breakpoint condition evaluates to null: " + script);
  } else if (!(result instanceof Boolean)) {
    throw new DebuggerException("Script does not return boolean value: " + script);
  }

  return (Boolean) result;
}
 
开发者ID:camunda,项目名称:camunda-bpm-workbench,代码行数:24,代码来源:ScriptBreakPointCondition.java


示例9: breakOnOperation

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public boolean breakOnOperation(AtomicOperation operation, ExecutionEntity execution) {
  boolean shouldBreak = true;

  shouldBreak &= processDefinitionId.equals(execution.getProcessDefinitionId());

  if(AT_TRANSITION.equals(breakPointSpec)) {
    shouldBreak &= transitionId.equals(execution.getCurrentTransitionId());
  } else {
    shouldBreak &= activityId.equals(execution.getActivityId());
  }

  shouldBreak &= breakPointSpec.breakOnOperation(operation);

  if (shouldBreak && condition != null) {
    shouldBreak &= condition.evaluate(execution);
  }

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


示例10: execute

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public void execute(DebugSessionImpl debugSession, SuspendedExecutionImpl suspendedExecution) {
  CodeCompleterBuilder builder = new CodeCompleterBuilder();

  if (scopeId != null) {
    synchronized (suspendedExecution) {
      if(!suspendedExecution.isResumed) {
        ExecutionEntity executionEntity = suspendedExecution.getExecution();
        ScriptBindingsFactory bindingsFactory = Context.getProcessEngineConfiguration()
            .getScriptingEngines().getScriptBindingsFactory();
        Bindings scopeBindings = bindingsFactory.createBindings(executionEntity, new SimpleBindings());
        builder.bindings(scopeBindings);
      }
    }
  }

  List<CodeCompletionHint> hints = builder.buildCompleter().complete(prefix);
  debugSession.fireCodeCompletion(hints);
}
 
开发者ID:camunda,项目名称:camunda-bpm-workbench,代码行数:19,代码来源:CodeCompletionOperation.java


示例11: assignExecutionsToActivities

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
protected void assignExecutionsToActivities(List<ExecutionEntity> leaves) {
  for (ExecutionEntity leaf : leaves) {
    ScopeImpl activity = leaf.getActivity();

    if (activity != null) {
      if (leaf.getActivityInstanceId() != null) {
        EnsureUtil.ensureNotNull("activity", activity);
        submitExecution(leaf, activity);
      }
      mergeScopeExecutions(leaf);


    }
    else if (leaf.isProcessInstanceExecution()) {
      submitExecution(leaf, leaf.getProcessDefinition());
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:ActivityExecutionTreeMapping.java


示例12: validate

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
@Override
public boolean validate(final Object submittedValue, final FormFieldValidatorContext validatorContext) {

  final DelegateExecution execution = validatorContext.getExecution();

  if(shouldPerformPaContextSwitch(validatorContext.getExecution())) {
    ProcessApplicationReference processApplicationReference = ProcessApplicationContextUtil.getTargetProcessApplication((ExecutionEntity) execution);

    return Context.executeWithinProcessApplication(new Callable<Boolean>() {
      public Boolean call() throws Exception {
        return doValidate(submittedValue, validatorContext);
      }
    }, processApplicationReference, new InvocationContext(execution));

  } else {
    return doValidate(submittedValue, validatorContext);

  }

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:21,代码来源:DelegateFormFieldValidator.java


示例13: execute

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
@Override
public Incident execute(CommandContext commandContext) {
  EnsureUtil.ensureNotNull(BadUserRequestException.class, "Execution id cannot be null", "executionId", executionId);
  EnsureUtil.ensureNotNull(BadUserRequestException.class, "incidentType", incidentType);

  ExecutionEntity execution = commandContext.getExecutionManager().findExecutionById(executionId);
  EnsureUtil.ensureNotNull(BadUserRequestException.class,
      "Cannot find an execution with executionId '" + executionId + "'", "execution", execution);
  EnsureUtil.ensureNotNull(BadUserRequestException.class, "Execution must be related to an activity", "activity",
      execution.getActivity());

  for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
    checker.checkUpdateProcessInstance(execution);
  }

  return execution.createIncident(incidentType, configuration, message);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:CreateIncidentCmd.java


示例14: resolveIncident

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
@Test
public void resolveIncident() {
  testRule.deployAndGetDefinition(ProcessModels.TWO_TASKS_PROCESS);

  ProcessInstance processInstance = engineRule.getRuntimeService().startProcessInstanceByKey("Process");
  ExecutionEntity execution = (ExecutionEntity) engineRule.getRuntimeService().createExecutionQuery().active().singleResult();

  authRule.disableAuthorization();
  Incident incident = engineRule.getRuntimeService()
      .createIncident("foo", execution.getId(), execution.getActivityId(), "bar");

  authRule
      .init(scenario)
      .withUser("userId")
      .bindResource("processInstance", processInstance.getId())
      .bindResource("processDefinition", "Process")
      .start();

  // when
  engineRule.getRuntimeService().resolveIncident(incident.getId());

  // then
  authRule.assertScenario(scenario);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:CreateAndResolveIncidentAuthorizationTest.java


示例15: inContextOf

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public UserOperationLogContextEntryBuilder inContextOf(ExecutionEntity processInstance, List<PropertyChange> propertyChanges) {

    if (propertyChanges == null || propertyChanges.isEmpty()) {
      if (OPERATION_TYPE_CREATE.equals(entry.getOperationType())) {
        propertyChanges = Arrays.asList(PropertyChange.EMPTY_CHANGE);
      }
    }
    entry.setPropertyChanges(propertyChanges);
    entry.setProcessInstanceId(processInstance.getProcessInstanceId());
    entry.setProcessDefinitionId(processInstance.getProcessDefinitionId());
    entry.setExecutionId(processInstance.getId());
    entry.setCaseInstanceId(processInstance.getCaseInstanceId());

    ResourceDefinitionEntity definition = processInstance.getProcessDefinition();
    if (definition != null) {
      entry.setProcessDefinitionKey(definition.getKey());
      entry.setDeploymentId(definition.getDeploymentId());
    }

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


示例16: handleEvent

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
protected void handleEvent(VariableEvent event) {
  AbstractVariableScope sourceScope = event.getSourceScope();

  if (sourceScope instanceof ExecutionEntity) {
    addEventToScopeExecution((ExecutionEntity) sourceScope, event);
  } else if (sourceScope instanceof TaskEntity) {
    TaskEntity task = (TaskEntity) sourceScope;
    ExecutionEntity execution = task.getExecution();
    if (execution != null) {
      addEventToScopeExecution(execution, event);
    }
  } else if(sourceScope.getParentVariableScope() instanceof ExecutionEntity) {
    addEventToScopeExecution((ExecutionEntity)sourceScope.getParentVariableScope(), event);
  }
  else {
    throw new ProcessEngineException("BPMN execution scope expected");
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:VariableListenerInvocationListener.java


示例17: createActivityInstanceEndEvt

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public HistoryEvent createActivityInstanceEndEvt(DelegateExecution execution) {
  final ExecutionEntity executionEntity = (ExecutionEntity) execution;

  // create event instance
  HistoricActivityInstanceEventEntity evt = loadActivityInstanceEventEntity(executionEntity);
  evt.setActivityInstanceState(executionEntity.getActivityInstanceState());

  // initialize event
  initActivityInstanceEvent(evt, (ExecutionEntity) execution, HistoryEventTypes.ACTIVITY_INSTANCE_END);

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

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


示例18: MigratingEventScopeInstance

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
public MigratingEventScopeInstance(
    MigrationInstruction migrationInstruction,
    ExecutionEntity eventScopeExecution,
    ScopeImpl sourceScope,
    ScopeImpl targetScope,
    MigrationInstruction eventSubscriptionInstruction,
    EventSubscriptionEntity eventSubscription,
    ScopeImpl eventSubscriptionSourceScope,
    ScopeImpl eventSubscriptionTargetScope
    ) {
  this.migratingEventSubscription =
      new MigratingCompensationEventSubscriptionInstance(
          eventSubscriptionInstruction,
          eventSubscriptionSourceScope,
          eventSubscriptionTargetScope,
          eventSubscription);
  this.migrationInstruction = migrationInstruction;
  this.eventScopeExecution = eventScopeExecution;

  // compensation handlers (not boundary events)
  this.sourceScope = sourceScope;
  this.targetScope = targetScope;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:MigratingEventScopeInstance.java


示例19: createHistoryEvent

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的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


示例20: execute

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入依赖的package包/类
@Override
public Void execute(CommandContext commandContext) {
  final Incident incident = commandContext.getIncidentManager().findIncidentById(incidentId);

  EnsureUtil.ensureNotNull(NotFoundException.class, "Cannot find an incident with id '" + incidentId + "'",
      "incident", incident);

  if (incident.getIncidentType().equals("failedJob") || incident.getIncidentType().equals("failedExternalTask")) {
    throw new BadUserRequestException("Cannot resolve an incident of type " + incident.getIncidentType());
  }

  EnsureUtil.ensureNotNull(BadUserRequestException.class, "", "executionId", incident.getExecutionId());
  ExecutionEntity execution = commandContext.getExecutionManager().findExecutionById(incident.getExecutionId());

  EnsureUtil.ensureNotNull(BadUserRequestException.class,
      "Cannot find an execution for an incident with id '" + incidentId + "'", "execution", execution);

  for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
    checker.checkUpdateProcessInstance(execution);
  }

  execution.resolveIncident(incidentId);
  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:ResolveIncidentCmd.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DecisionTreeModel类代码示例发布时间:2022-05-22
下一篇:
Java MarshallingException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap