Search in sources :

Example 76 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class TaskEntity method setAssignee.

@Override
public void setAssignee(String assignee) {
    ensureTaskActive();
    registerCommandContextCloseListener();
    String oldAssignee = this.assignee;
    if (assignee == null && oldAssignee == null) {
        return;
    }
    addIdentityLinkChanges(IdentityLinkType.ASSIGNEE, oldAssignee, assignee);
    propertyChanged(ASSIGNEE, oldAssignee, assignee);
    this.assignee = assignee;
    CommandContext commandContext = Context.getCommandContext();
    // setAssignee outside a service method.  E.g. while creating a new task.
    if (commandContext != null) {
        fireEvent(TaskListener.EVENTNAME_ASSIGNMENT);
        if (commandContext.getDbEntityManager().contains(this)) {
            fireAssigneeAuthorizationProvider(oldAssignee, assignee);
            fireHistoricIdentityLinks();
        }
    }
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext)

Example 77 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class TaskEntity method update.

public void update() {
    ensureTenantIdNotChanged();
    registerCommandContextCloseListener();
    CommandContext commandContext = Context.getCommandContext();
    DbEntityManager dbEntityManger = commandContext.getDbEntityManager();
    dbEntityManger.merge(this);
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext) DbEntityManager(org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager)

Example 78 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class TaskEntity method setOwner.

@Override
public void setOwner(String owner) {
    ensureTaskActive();
    registerCommandContextCloseListener();
    String oldOwner = this.owner;
    if (owner == null && oldOwner == null) {
        return;
    }
    addIdentityLinkChanges(IdentityLinkType.OWNER, oldOwner, owner);
    propertyChanged(OWNER, oldOwner, owner);
    this.owner = owner;
    CommandContext commandContext = Context.getCommandContext();
    // setOwner outside a service method.  E.g. while creating a new task.
    if (commandContext != null && commandContext.getDbEntityManager().contains(this)) {
        fireOwnerAuthorizationProvider(oldOwner, owner);
        this.fireHistoricIdentityLinks();
    }
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext)

Example 79 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class TaskEntity method insert.

public void insert(ExecutionEntity execution) {
    ensureParentTaskActive();
    propagateExecutionTenantId(execution);
    propagateParentTaskTenantId();
    CommandContext commandContext = Context.getCommandContext();
    TaskManager taskManager = commandContext.getTaskManager();
    taskManager.insertTask(this);
    if (execution != null) {
        execution.addTask(this);
    }
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext)

Example 80 with CommandContext

use of org.camunda.bpm.engine.impl.interceptor.CommandContext in project camunda-bpm-platform by camunda.

the class TaskEntity method deleteAuthorizations.

protected void deleteAuthorizations(AuthorizationEntity[] authorizations) {
    CommandContext commandContext = Context.getCommandContext();
    TaskManager taskManager = commandContext.getTaskManager();
    taskManager.deleteDefaultAuthorizations(authorizations);
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext)

Aggregations

CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)120 CommandExecutor (org.camunda.bpm.engine.impl.interceptor.CommandExecutor)31 List (java.util.List)17 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)17 JobEntity (org.camunda.bpm.engine.impl.persistence.entity.JobEntity)11 Deployment (org.camunda.bpm.engine.test.Deployment)11 ArrayList (java.util.ArrayList)10 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)10 Date (java.util.Date)9 HistoricIncident (org.camunda.bpm.engine.history.HistoricIncident)8 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)8 JobManager (org.camunda.bpm.engine.impl.persistence.entity.JobManager)8 Command (org.camunda.bpm.engine.impl.interceptor.Command)6 HistoricIncidentEntity (org.camunda.bpm.engine.impl.persistence.entity.HistoricIncidentEntity)6 After (org.junit.After)6 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)5 RepositoryService (org.camunda.bpm.engine.RepositoryService)5 ProcessEngineImpl (org.camunda.bpm.engine.impl.ProcessEngineImpl)5 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)5 HistoricDecisionInstance (org.camunda.bpm.engine.history.HistoricDecisionInstance)4