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

org.jbpt.petri.untangling.AbstractProcess Maven / Gradle / Ivy

Go to download

The jBPT code library is a compendium of technologies that support research on design, execution, and evaluation of business processes.

The newest version!
package org.jbpt.petri.untangling;

import org.jbpt.petri.IFlow;
import org.jbpt.petri.IMarking;
import org.jbpt.petri.INetSystem;
import org.jbpt.petri.INode;
import org.jbpt.petri.IPlace;
import org.jbpt.petri.ITransition;
import org.jbpt.petri.unfolding.AbstractBranchingProcess;
import org.jbpt.petri.unfolding.IBPNode;
import org.jbpt.petri.unfolding.ICondition;
import org.jbpt.petri.unfolding.IEvent;

/**
 * An abstract implementation of the {@link IProcess} interface.
 * 
 * @author Artem Polyvyanyy
 */
public abstract class AbstractProcess, C extends ICondition, E extends IEvent, F extends IFlow, N extends INode, P extends IPlace, T extends ITransition, M extends IMarking> 
		extends AbstractBranchingProcess 
		implements IProcess
{

	protected AbstractProcess() {
		super();
	}

	/**
	 * Construct a process of a given net system.
	 *  
	 * @param sys A net system.
	 */
	public AbstractProcess(INetSystem sys) {
		super(sys);
	}

	/**
	 * Append event to this process (ensures that no conflicts are introduced).
	 * 
	 * @param event An event to append.
	 * @return true if 'event' was appended; false otherwise.
	 */
	@Override
	public boolean appendEvent(E event) {
		for (E e : this.getEvents()) {
			for (C c: event.getPreConditions())
				if (e.getPreConditions().contains(c))
					return false;
		}
		
		return super.appendEvent(event);
	}

	/**
	 * Check if this process is conflict free.
	 * 
	 *  @return true if this process is conflict-free; false otherwise.
	 */
	@Override
	public boolean isConflictFree() {
		return true;
	} 
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy