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

io.takari.bpm.model.SequenceFlow Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
package io.takari.bpm.model;

import java.util.Arrays;

public class SequenceFlow extends AbstractElement {
	
	private static final long serialVersionUID = 1L;

    private String name;
    private final String from;
    private final String to;
    private final String expression;
    private final ExecutionListener[] listeners;

    public SequenceFlow(String id, String from, String to) {
        this(id, from, to, null, (ExecutionListener[]) null);
    }
    
    public SequenceFlow(String id, String from, String to, String expression) {
        this(id, from, to, expression, (ExecutionListener[]) null);
    }
    
    public SequenceFlow(String id, String from, String to, ExecutionListener ... listeners) {
        this(id, from, to, null, listeners);
    }

    public SequenceFlow(String id, String from, String to, String expression, ExecutionListener ... listeners) {
        super(id);
        this.from = from;
        this.to = to;
        this.expression = expression;
        this.listeners = listeners;
    }

    public String getFrom() {
        return from;
    }

    public String getTo() {
        return to;
    }

    public String getExpression() {
        return expression;
    }

    public ExecutionListener[] getListeners() {
        return listeners;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public static final class ExecutionListener {
        
        private final String event;
        private final ExpressionType type;
        private final String expression;

        public ExecutionListener(String event, ExpressionType type, String expression) {
            this.event = event;
            this.type = type;
            this.expression = expression;
        }

        public String getEvent() {
            return event;
        }

        public ExpressionType getType() {
            return type;
        }

        public String getExpression() {
            return expression;
        }
    }

    @Override
    public String toString() {
        return "SequenceFlow (" + getId() + ") {" +
                "name='" + name + '\'' +
                ", " + from + " -> " + to + '\'' +
                ", expression='" + expression + '\'' +
                ", listeners=" + Arrays.toString(listeners) +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy