package ua.be.wee.controller;

import ua.be.wee.model.nodes.AutomatedActivity;
import ua.be.wee.model.nodes.FinalNode;
import ua.be.wee.model.nodes.ports.ControlInputPort;

public class PMTrigger {
	
	private FinalNode node;
	
	public FinalNode getNode() {
		return node;
	}

	public void setNode(FinalNode node) {
		this.node = node;
	}

	public ControlInputPort getPort() {
		return port;
	}

	public void setPort(ControlInputPort port) {
		this.port = port;
	}

	private ControlInputPort port;
	
	public String getName() {
		if (port != null) {
			return (port.getActivity() instanceof AutomatedActivity ? "AUT: " + port.getActivity().getName() + " VIA PORT: " + port.getName() :  port.getActivity().getName() + " VIA PORT: " + port.getName());
		} else {
			return "END TRACE";
		}
	}
	
	public String getIri() {
		if (port != null) {
			return port.getIri();
		} else {
			return node.getIri();
		}
	}

}
