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

be.personify.iam.model.vault.WorkflowRequest Maven / Gradle / Ivy

There is a newer version: 1.5.2.RELEASE
Show newest version
package be.personify.iam.model.vault;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import be.personify.util.generator.MetaInfo;
import be.personify.iam.model.ConceptType;
import be.personify.iam.model.util.ConceptAction;
import be.personify.iam.model.util.Persisted;
import be.personify.iam.model.util.WorkflowStatus;

@Entity
@MetaInfo( group="vault", frontendGroup="Governance", name="Workflow Request", description="A wfr", 
		showInMenu=true, 
		iconClass="paste", 
				number=18,
		sortOrderInGroup=1,
		showDeleteButtonOnSearchResult = false,
		persistentPropertiesToIncludeOnEntityPage = "creationDate",
		sortProperty = "creationDate",
		sortOrder = "descending",
		persistentPropertiesToIncludeOnSearchResult = "creationDate", 
		isConcept = false)
@Table(name="workflow_request", indexes = {
		@Index(name = "idx_wfr_type_action",  columnList = "concept_action,concept_type", unique=false),
		@Index(name = "idx_wfr_status", columnList = "workflow_status", unique=false)
})
public class WorkflowRequest extends Persisted implements Serializable {
	
	private static final long serialVersionUID = 8635621823354309669L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@MetaInfo(name="id", description="The id of the workflow request", showInSearchResultGrid = false, searchable = false)
	private long id;

	@Enumerated(EnumType.STRING)
    @NotNull
    @Column(name="concept_action")
	@MetaInfo(name="conceptAction", description="The conceptAction of the workflow request")
	private ConceptAction conceptAction;
	
	@Enumerated(EnumType.STRING)
    @NotNull
    @Column(name="concept_type")
	@MetaInfo(name="conceptType", description="The conceptType of the workflow request")
	private ConceptType conceptType;

	@Enumerated(EnumType.STRING)
    @NotNull
    @Column(name="workflow_status")
	@MetaInfo(name="workflowStatus", description="The workflowStatus of the workflow request ( WAITING,PROCESSING, FINISHED, ....)")
	private WorkflowStatus workflowStatus;

	@MetaInfo(name="conceptHref", description="The concept reference of the workflow request", showInSearchResultGrid = false, searchable = false)
	private String conceptHref;

	@Column(columnDefinition = "TEXT")
	@MetaInfo(name="conceptString", description="The concept as a string of the workflow request", showInSearchResultGrid = false, customRenderer = "text_area|rows:10", searchable = false)
	private String conceptString;
	
	@OneToOne
	@MetaInfo(searchable=false,showInSearchResultGrid=true, editable = false, name="treatedBy", description = "the identity that approved or rejected the workflow request", customRenderer = "autoCompleteTextField|search_fields=lastName|display_fields=lastName,firstName,code")
	private Identity treatedBy;
	
	@OneToMany(mappedBy="workflowRequest", cascade=CascadeType.ALL)
	@ElementCollection(targetClass=OrganisationAssignment.class)
	@MetaInfo( name="workflowTasks", description="The workflowTasks to which the req is linked. See workflowTask_", dashboardSubtypeDirection = "organisation.name")
	private List workflowTasks;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public ConceptAction getConceptAction() {
		return conceptAction;
	}

	public void setConceptAction(ConceptAction conceptAction) {
		this.conceptAction = conceptAction;
	}

	public ConceptType getConceptType() {
		return conceptType;
	}

	public void setConceptType(ConceptType conceptType) {
		this.conceptType = conceptType;
	}

	public WorkflowStatus getWorkflowStatus() {
		return workflowStatus;
	}

	public void setWorkflowStatus(WorkflowStatus workflowStatus) {
		this.workflowStatus = workflowStatus;
	}

	public String getConceptHref() {
		return conceptHref;
	}

	public void setConceptHref(String conceptHref) {
		this.conceptHref = conceptHref;
	}

	public String getConceptString() {
		return conceptString;
	}

	public void setConceptString(String conceptString) {
		this.conceptString = conceptString;
	}

	public Identity getTreatedBy() {
		return treatedBy;
	}

	public void setTreatedBy(Identity treatedBy) {
		this.treatedBy = treatedBy;
	}
	
	

	public List getWorkflowTasks() {
		return workflowTasks;
	}

	public void setWorkflowTasks(List workflowTasks) {
		this.workflowTasks = workflowTasks;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((conceptAction == null) ? 0 : conceptAction.hashCode());
		result = prime * result + ((conceptHref == null) ? 0 : conceptHref.hashCode());
		result = prime * result + ((conceptString == null) ? 0 : conceptString.hashCode());
		result = prime * result + ((conceptType == null) ? 0 : conceptType.hashCode());
		result = prime * result + (int) (id ^ (id >>> 32));
		result = prime * result + ((treatedBy == null) ? 0 : treatedBy.hashCode());
		result = prime * result + ((workflowStatus == null) ? 0 : workflowStatus.hashCode());
		result = prime * result + ((workflowTasks == null) ? 0 : workflowTasks.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		WorkflowRequest other = (WorkflowRequest) obj;
		if (conceptAction != other.conceptAction)
			return false;
		if (conceptHref == null) {
			if (other.conceptHref != null)
				return false;
		} else if (!conceptHref.equals(other.conceptHref))
			return false;
		if (conceptString == null) {
			if (other.conceptString != null)
				return false;
		} else if (!conceptString.equals(other.conceptString))
			return false;
		if (conceptType != other.conceptType)
			return false;
		if (id != other.id)
			return false;
		if (treatedBy == null) {
			if (other.treatedBy != null)
				return false;
		} else if (!treatedBy.equals(other.treatedBy))
			return false;
		if (workflowStatus != other.workflowStatus)
			return false;
		if (workflowTasks == null) {
			if (other.workflowTasks != null)
				return false;
		} else if (!workflowTasks.equals(other.workflowTasks))
			return false;
		return true;
	}

	
	
	
	
	
	
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy