All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.activiti.bpmn.model.UserTask Maven / Gradle / Ivy

The newest version!
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.activiti.bpmn.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author Tijs Rademakers
 */
public class UserTask extends Task {

  protected String assignee;
  protected String owner;
  protected String priority;
  protected String formKey;
  protected String dueDate;
  protected String category;
  protected String extensionId;
  protected List candidateUsers = new ArrayList();
  protected List candidateGroups = new ArrayList();
  protected List formProperties = new ArrayList();
  protected List taskListeners = new ArrayList();
  protected String skipExpression;

  protected Map> customUserIdentityLinks = new HashMap>(); 
  protected Map> customGroupIdentityLinks = new HashMap>();
  
  protected List customProperties = new ArrayList();

  public String getAssignee() {
    return assignee;
  }
  public void setAssignee(String assignee) {
    this.assignee = assignee;
  }
  public String getOwner() {
    return owner;
  }
  public void setOwner(String owner) {
    this.owner = owner;
  }
  public String getPriority() {
    return priority;
  }
  public void setPriority(String priority) {
    this.priority = priority;
  }
  public String getFormKey() {
    return formKey;
  }
  public void setFormKey(String formKey) {
    this.formKey = formKey;
  }
  public String getDueDate() {
    return dueDate;
  }
  public void setDueDate(String dueDate) {
    this.dueDate = dueDate;
  }
  public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getExtensionId() {
    return extensionId;
  }
  public void setExtensionId(String extensionId) {
    this.extensionId = extensionId;
  }
  public boolean isExtended() {
    return extensionId != null && !extensionId.isEmpty();
  }
	public List getCandidateUsers() {
    return candidateUsers;
  }
  public void setCandidateUsers(List candidateUsers) {
    this.candidateUsers = candidateUsers;
  }
  public List getCandidateGroups() {
    return candidateGroups;
  }
  public void setCandidateGroups(List candidateGroups) {
    this.candidateGroups = candidateGroups;
  }
  public List getFormProperties() {
    return formProperties;
  }
  public void setFormProperties(List formProperties) {
    this.formProperties = formProperties;
  }
  public List getTaskListeners() {
    return taskListeners;
  }
  public void setTaskListeners(List taskListeners) {
    this.taskListeners = taskListeners;
  }
  
  public void addCustomUserIdentityLink(String userId, String type){
	  Set userIdentitySet = customUserIdentityLinks.get(type);
	  
	  if(userIdentitySet == null){
		  userIdentitySet = new HashSet();
		  customUserIdentityLinks.put(type, userIdentitySet);
	  }
	  
	  userIdentitySet.add(userId);
  }
  
  public void addCustomGroupIdentityLink(String groupId, String type){
	  Set groupIdentitySet = customGroupIdentityLinks.get(type);
	  
	  if(groupIdentitySet == null){
		  groupIdentitySet = new HashSet();
		  customGroupIdentityLinks.put(type, groupIdentitySet);
	  }
	  
	  groupIdentitySet.add(groupId);
  }
  
  public Map> getCustomUserIdentityLinks() {
	return customUserIdentityLinks;
  }
  
  public void setCustomUserIdentityLinks(
		Map> customUserIdentityLinks) {
	this.customUserIdentityLinks = customUserIdentityLinks;
  }
  
  public Map> getCustomGroupIdentityLinks() {
	return customGroupIdentityLinks;
  }
  
  public void setCustomGroupIdentityLinks(Map> customGroupIdentityLinks) {
    this.customGroupIdentityLinks = customGroupIdentityLinks;
  }
  
  public List getCustomProperties() {
    return customProperties;
  }
  public void setCustomProperties(List customProperties) {
    this.customProperties = customProperties;
  }
  
  public String getSkipExpression() {
    return skipExpression;
  }
  
  public void setSkipExpression(String skipExpression) {
    this.skipExpression = skipExpression;
  }
  public UserTask clone() {
    UserTask clone = new UserTask();
    clone.setValues(this);
    return clone;
  }
  
  public void setValues(UserTask otherElement) {
    super.setValues(otherElement);
    setAssignee(otherElement.getAssignee());
    setOwner(otherElement.getOwner());
    setFormKey(otherElement.getFormKey());
    setDueDate(otherElement.getDueDate());
    setPriority(otherElement.getPriority());
    setCategory(otherElement.getCategory());
    setExtensionId(otherElement.getExtensionId());
    
    setCandidateGroups(new ArrayList(otherElement.getCandidateGroups()));
    setCandidateUsers(new ArrayList(otherElement.getCandidateUsers()));
    
    setCustomGroupIdentityLinks(otherElement.customGroupIdentityLinks);
    setCustomUserIdentityLinks(otherElement.customUserIdentityLinks);
    
    formProperties = new ArrayList();
    if (otherElement.getFormProperties() != null && !otherElement.getFormProperties().isEmpty()) {
      for (FormProperty property : otherElement.getFormProperties()) {
        formProperties.add(property.clone());
      }
    }
    
    taskListeners = new ArrayList();
    if (otherElement.getTaskListeners() != null && !otherElement.getTaskListeners().isEmpty()) {
      for (ActivitiListener listener : otherElement.getTaskListeners()) {
        taskListeners.add(listener.clone());
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy