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

org.yaoqiang.bpmn.model.elementsAssociation Maven / Gradle / Ivy

package org.yaoqiang.bpmn.model.elements.artifacts;

import org.yaoqiang.bpmn.model.elements.XMLAttribute;

/**
 * Association
 * 
 * @author Shi Yaoqiang([email protected])
 */
public class Association extends Artifact {

	private static final long serialVersionUID = -3540877095970278706L;

	public Association(Artifacts parent) {
		super(parent, "association");
	}

	protected void fillStructure() {
		XMLAttribute attrSourceRef = new XMLAttribute(this, "sourceRef");
		XMLAttribute attrTargetRef = new XMLAttribute(this, "targetRef");
		XMLAttribute attrAssociationDirection = new XMLAttribute(this, "associationDirection", AssociationDirection.None.toString());

		super.fillStructure();
		add(attrSourceRef);
		add(attrTargetRef);
		add(attrAssociationDirection);
	}

	public Artifacts getParent() {
		return (Artifacts) parent;
	}
	
	public final String getSourceRef() {
		return get("sourceRef").toValue();
	}

	public final String getTargetRef() {
		return get("targetRef").toValue();
	}

	public final void setSourceRef(String sourceRef) {
		set("sourceRef", sourceRef);
	}
	
	public final void setTargetRef(String targetRef) {
		set("targetRef", targetRef);
	}
	
	public final void setAssociationDirection(String associationDirection) {
		set("associationDirection", associationDirection);
	}
	
	enum AssociationDirection {

		None("None"), One("One"), Both("Both");

		private String direction;

		AssociationDirection(String direction) {
			this.setDirection(direction);
		}

		public void setDirection(String direction) {
			this.direction = direction;
		}

		public String getDirection() {
			return direction;
		}
		
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy