Package org.camunda.bpm.engine.impl.interceptor

Examples of org.camunda.bpm.engine.impl.interceptor.CommandContext


  // PROCESS DEFINITION ////////////////////////////////////////////////////////////////////////////////

  public ProcessDefinitionEntity findDeployedProcessDefinitionById(String processDefinitionId) {
    ensureNotNull("Invalid process definition id", "processDefinitionId", processDefinitionId);
    CommandContext commandContext = Context.getCommandContext();
    ProcessDefinitionEntity processDefinition = commandContext.getDbEntityManager().getCachedEntity(ProcessDefinitionEntity.class, processDefinitionId);
    if (processDefinition == null) {
      processDefinition = commandContext
        .getProcessDefinitionManager()
        .findLatestProcessDefinitionById(processDefinitionId);
    }
    ensureNotNull("no deployed process definition found with id '" + processDefinitionId + "'", "processDefinition", processDefinition);
    processDefinition = resolveProcessDefinition(processDefinition);
View Full Code Here


  // CASE DEFINITION ////////////////////////////////////////////////////////////////////////////////

  public CaseDefinitionEntity findDeployedCaseDefinitionById(String caseDefinitionId) {
    ensureNotNull("Invalid case definition id", "caseDefinitionId", caseDefinitionId);

    CommandContext commandContext = Context.getCommandContext();

    // try to load case definition from cache
    CaseDefinitionEntity caseDefinition = commandContext
      .getDbEntityManager()
      .getCachedEntity(CaseDefinitionEntity.class, caseDefinitionId);

    if (caseDefinition == null) {

      // if not found, then load the case definition
      // from db
      caseDefinition = commandContext
        .getCaseDefinitionManager()
        .findCaseDefinitionById(caseDefinitionId);

    }
View Full Code Here

    removeAllCaseDefinitionsByDeploymentId(deploymentId);
  }

  protected void removeAllProcessDefinitionsByDeploymentId(String deploymentId) {
    // remove all process definitions for a specific deployment
    CommandContext commandContext = Context.getCommandContext();

    List<ProcessDefinition> allDefinitionsForDeployment = new ProcessDefinitionQueryImpl(commandContext)
        .deploymentId(deploymentId)
        .list();
View Full Code Here

    }
  }

  protected void removeAllCaseDefinitionsByDeploymentId(String deploymentId) {
    // remove all case definitions for a specific deployment
    CommandContext commandContext = Context.getCommandContext();

    List<CaseDefinition> allDefinitionsForDeployment = new CaseDefinitionQueryImpl(commandContext)
        .deploymentId(deploymentId)
        .list();
View Full Code Here

    this.signalDefinition = signalDefinition;
  }
 
  public void execute(ActivityExecution execution) throws Exception {
   
    CommandContext commandContext = Context.getCommandContext();
   
    List<SignalEventSubscriptionEntity> findSignalEventSubscriptionsByEventName = commandContext
        .getEventSubscriptionManager()
        .findSignalEventSubscriptionsByEventName(signalDefinition.getEventName());
     
      for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : findSignalEventSubscriptionsByEventName) {
        signalEventSubscriptionEntity.eventReceived(null, signalDefinition.isAsync());
View Full Code Here

    if(execution == null) {
      throw new BadUserRequestException("No case instance found for id '" + caseInstanceId + "'");
    }

    CommandContext commandContext = Context.getCommandContext();
    commandContext
      .getTaskManager()
      .deleteTasksByCaseInstanceId(caseInstanceId, deleteReason, cascade);

    execution.deleteCascade();
View Full Code Here

  public void remove() {
    super.remove();

    variableStore.removeVariablesWithoutFiringEvents();

    CommandContext commandContext = Context.getCommandContext();

    for (CaseSentryPartEntity sentryPart : getCaseSentryParts()) {
      commandContext
        .getCaseSentryPartManager()
        .deleteSentryPart(sentryPart);
    }

    // finally delete this execution
    commandContext
      .getCaseExecutionManager()
      .deleteCaseExecution(this);
  }
View Full Code Here

  public void deleteTask(TaskEntity task, String deleteReason, boolean cascade) {
    if (!task.isDeleted()) {
      task.setDeleted(true);

      CommandContext commandContext = Context.getCommandContext();
      String taskId = task.getId();

      List<Task> subTasks = findTasksByParentTaskId(taskId);
      for (Task subTask: subTasks) {
        ((TaskEntity) subTask).delete(deleteReason, cascade);
      }

      commandContext
        .getIdentityLinkManager()
        .deleteIdentityLinksByTaskId(taskId);

      commandContext
        .getVariableInstanceManager()
        .deleteVariableInstanceByTask(task);

      if (cascade) {
        commandContext
          .getHistoricTaskInstanceManager()
          .deleteHistoricTaskInstanceById(taskId);
      } else {
        commandContext
          .getHistoricTaskInstanceManager()
          .markTaskInstanceEnded(taskId, deleteReason);
        if (TaskEntity.DELETE_REASON_COMPLETED.equals(deleteReason)) {
          task.createHistoricTaskDetails(UserOperationLogEntry.OPERATION_TYPE_COMPLETE);
        } else {
View Full Code Here

    eventHandler.handleEvent(this, payload, Context.getCommandContext());
  }
 
  protected void scheduleEventAsync(Serializable payload) {
   
    final CommandContext commandContext = Context.getCommandContext();

    MessageEntity message = new MessageEntity();
    message.setJobHandlerType(ProcessEventJobHandler.TYPE);
    message.setJobHandlerConfiguration(id);

    // TODO: support payload
//    if(payload != null) {
//      message.setEventPayload(payload);
//    }
   
    commandContext.getJobManager().send(message);
  }
View Full Code Here

    }
  }

  public void deleteHistoricCaseInstanceById(String historicCaseInstanceId) {
    if (isHistoryEnabled()) {
      CommandContext commandContext = Context.getCommandContext();

      commandContext
        .getHistoricDetailManager()
        .deleteHistoricDetailsByCaseInstanceId(historicCaseInstanceId);

      commandContext
        .getHistoricVariableInstanceManager()
        .deleteHistoricVariableInstanceByCaseInstanceId(historicCaseInstanceId);

      commandContext
        .getHistoricCaseActivityInstanceManager()
        .deleteHistoricCaseActivityInstancesByCaseInstanceId(historicCaseInstanceId);

      commandContext
        .getHistoricTaskInstanceManager()
        .deleteHistoricTaskInstancesByCaseInstanceId(historicCaseInstanceId);

      commandContext
          .getOperationLogManager()
          .deleteOperationLogEntriesByCaseInstanceId(historicCaseInstanceId);

      commandContext.getDbEntityManager().delete(HistoricCaseInstanceEntity.class, "deleteHistoricCaseInstance", historicCaseInstanceId);

    }
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.impl.interceptor.CommandContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.