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

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


    businessProcess.setVariable("processName", "throwSignal-visited (was " + businessProcess.getVariable("processName"+ ")");

    String signalProcessInstanceId = (String) execution.getVariable("signalProcessInstanceId");     
    String executionId = runtimeService.createExecutionQuery().processInstanceId(signalProcessInstanceId).signalEventSubscriptionName("alert").singleResult().getId();     
   
    CommandContext commandContext = Context.getCommandContext();
    List<SignalEventSubscriptionEntity> findSignalEventSubscriptionsByEventName = commandContext
            .getEventSubscriptionManager()
            .findSignalEventSubscriptionsByNameAndExecution("alert", executionId);

    for (SignalEventSubscriptionEntity signalEventSubscriptionEntity : findSignalEventSubscriptionsByEventName) {
        signalEventSubscriptionEntity.eventReceived(null, true);
View Full Code Here


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

    CommandContext commandContext = Context.getCommandContext();
    commandContext
      .getTaskManager()
      .deleteTasksByProcessInstanceId(processInstanceId, deleteReason, cascade);

    // delete the execution BEFORE we delete the history, otherwise we will produce orphan HistoricVariableInstance instances
    execution.deleteCascade(deleteReason, skipCustomListeners);

    if (cascade) {
      commandContext
      .getHistoricProcessInstanceManager()
      .deleteHistoricProcessInstanceById(processInstanceId);
    }
  }
View Full Code Here

    COMMAND_CONTEXT_FUNCTION_MAP.put("currentUser", ReflectUtil.getMethod(mapperClass, "currentUser"));
    COMMAND_CONTEXT_FUNCTION_MAP.put("currentUserGroups", ReflectUtil.getMethod(mapperClass, "currentUserGroups"));
  }

  public static String currentUser() {
    CommandContext commandContext = Context.getCommandContext();
    if (commandContext != null) {
      return commandContext.getAuthenticatedUserId();
    }
    else {
      return null;
    }
  }
View Full Code Here

      return null;
    }
  }

  public static List<String> currentUserGroups() {
    CommandContext commandContext = Context.getCommandContext();
    if (commandContext != null) {
      return commandContext.getAuthenticatedGroupIds();
    }
    else {
      return null;
    }
  }
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

  }

  public void insert(ExecutionEntity execution) {
    ensureParentTaskActive();

    CommandContext commandContext = Context.getCommandContext();
    DbEntityManager dbEntityManger = commandContext.getDbEntityManager();
    dbEntityManger.insert(this);

    if(execution != null) {
      execution.addTask(this);
    }
View Full Code Here

  }

  public void update() {
    registerCommandContextCloseListener();

    CommandContext commandContext = Context.getCommandContext();
    DbEntityManager dbEntityManger = commandContext.getDbEntityManager();
    dbEntityManger.merge(this);
  }
View Full Code Here

    }

    propertyChanged(ASSIGNEE, this.assignee, assignee);
    this.assignee = assignee;

    CommandContext commandContext = Context.getCommandContext();
    // if there is no command context, then it means that the user is calling the
    // setAssignee outside a service method.  E.g. while creating a new task.
    if (commandContext!=null) {
      fireEvent(TaskListener.EVENTNAME_ASSIGNMENT);
    }
View Full Code Here

  public void onCommandFailed(CommandContext commandContext, Throwable t) {
    // ignore
  }

  protected void registerCommandContextCloseListener() {
    CommandContext commandContext = Context.getCommandContext();
    if (commandContext!=null) {
      commandContext.registerCommandContextListener(this);
    }
  }
View Full Code Here

  public Map<String, PropertyChange> getPropertyChanges() {
    return propertyChanges;
  }

  public void createHistoricTaskDetails(String operation) {
    final CommandContext commandContext = Context.getCommandContext();
    if (commandContext != null) {
      List<PropertyChange> values = new ArrayList<PropertyChange>(propertyChanges.values());
      commandContext.getOperationLogManager().logTaskOperations(operation, this, values);
    }
    propertyChanges.clear();
  }
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.