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();
}
}
}
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);
}
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();
}
}
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);
}
}
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);
}
Aggregations