Java Code Examples for org.flowable.task.service.delegate.DelegateTask#getAssignee()

The following examples show how to use org.flowable.task.service.delegate.DelegateTask#getAssignee() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AssigneeOverwriteFromVariable.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public void notify(DelegateTask delegateTask) {
    // get mapping table from variable

    ExecutionEntity execution = CommandContextUtil.getExecutionEntityManager().findById(delegateTask.getExecutionId());
    Map<String, String> assigneeMappingTable = (Map<String, String>) execution.getVariable("assigneeMappingTable");

    // get assignee from process
    String assigneeFromProcessDefinition = delegateTask.getAssignee();

    // overwrite assignee if there is an entry in the mapping table
    if (assigneeMappingTable.containsKey(assigneeFromProcessDefinition)) {
        String assigneeFromMappingTable = assigneeMappingTable.get(assigneeFromProcessDefinition);
        delegateTask.setAssignee(assigneeFromMappingTable);
    }
}
 
Example 2
Source File: AssigneeOverwriteFromVariable.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public void notify(DelegateTask delegateTask) {
    // get mapping table from variable
    Map<String, String> assigneeMappingTable = (Map<String, String>) delegateTask.getVariable("assigneeMappingTable");

    // get assignee from process
    String assigneeFromProcessDefinition = delegateTask.getAssignee();

    // overwrite assignee if there is an entry in the mapping table
    if (assigneeMappingTable.containsKey(assigneeFromProcessDefinition)) {
        String assigneeFromMappingTable = assigneeMappingTable.get(assigneeFromProcessDefinition);
        delegateTask.setAssignee(assigneeFromMappingTable);
    }
}