@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (getUntilFinished() == null ? 0 : getUntilFinished() .hashCode()); result = prime * result + (parent == null ? 0 : parent.hashCode()); result = prime * result + (getBlock() == null ? 0 : getBlock().hashCode()); return result; }
@Override public void setParent(Processor parent) { if (this.parent == parent) return; if (this.parent != null && this.parent.getIterationStrategyStack() == this) this.parent.setIterationStrategyStack(null); this.parent = parent; if (parent != null && parent.getIterationStrategyStack() != this) parent.setIterationStrategyStack(this); }
/** * Updates the workflow identifier. * <p> * The {@link #getCurrentRevision()} will be replaced using using * {@link #newRevision()}. * */ public void updateWorkflowIdentifier() { newRevision(); }
/** * Constructs a <code>BlockingControlLink</code> with the specified blocked * and control <code>Processor</code>s. * <p> * The parent {@link Workflow} is set to be the same as the parent of the * block <code>Processor</code>. * * @param block * the <code>Processor</code> that is blocked from starting. * <strong>Must not</strong> be <code>null</code> * @param untilFinished * the <code>Processor</code> that controls the block. Can be * <code>null</code>. */ public BlockingControlLink(Processor block, Processor untilFinished) { setUntilFinished(untilFinished); setBlock(block); setParent(block.getParent()); }
@Override protected void cloneInto(WorkflowBean clone, Cloning cloning) { BlockingControlLink cloneLink = (BlockingControlLink) clone; cloneLink.setBlock(cloning.cloneOrOriginal(getBlock())); cloneLink.setUntilFinished(cloning.cloneOrOriginal(getUntilFinished())); }
@SuppressWarnings("unchecked") public List<BlockingControlLink> controlLinksBlocking(Processor blocked) { List<BlockingControlLink> controlLinks = new ArrayList<>(); for (ControlLink link : blocked.getParent().getControlLinks()) { if (!(link instanceof BlockingControlLink)) continue; BlockingControlLink blockingControlLink = (BlockingControlLink) link; if (blockingControlLink.getBlock().equals(blocked)) controlLinks.add(blockingControlLink); } Collections.sort(controlLinks); return controlLinks; }
@SuppressWarnings("unchecked") public List<BlockingControlLink> controlLinksWaitingFor( Processor untilFinished) { List<BlockingControlLink> controlLinks = new ArrayList<>(); for (ControlLink link : untilFinished.getParent().getControlLinks()) { if (!(link instanceof BlockingControlLink)) continue; BlockingControlLink blockingControlLink = (BlockingControlLink) link; if (blockingControlLink.getUntilFinished().equals(untilFinished)) controlLinks.add(blockingControlLink); } Collections.sort(controlLinks); return controlLinks; }
@Override public void setParent(Processor parent) { if (this.parent != null && this.parent != parent) this.parent.getOutputPorts().remove(this); this.parent = parent; if (parent != null) parent.getOutputPorts().add(this); }
public DummyWorkflow(WorkflowBundle parent) { super.setParent(parent); }
/** * Returns true if processor contains a nested workflow in any of its * activities in any of its profiles. */ public boolean containsNestedWorkflow(Processor processor) { for (Profile profile : processor.getParent().getParent().getProfiles()) if (containsNestedWorkflow(processor, profile)) return true; return false; }
@Override public void setParent(Workflow parent) { if (this.parent != null && this.parent != parent) this.parent.getOutputPorts().remove(this); this.parent = parent; if (parent != null) parent.getOutputPorts().add(this); }
/** * Constructs a <code>Processor</code> with the specified parent * {@link Workflow} and name. * * @param parent * the <code>Workflow</code> to set as the <code>Processor</code> * 's parent. Can be <code>null</code>. * @param name * the name of the <code>Processor</code>. <strong>Must * not</strong> be <code>null</code> or an empty String. */ public Processor(Workflow parent, String name) { super(name); setParent(parent); }
/** * Get the collection of processors that can be downstream of this * processor. * * @return A set of processors that it is legal to have a datalink or * control link from this processor to. * @see Scufl2Tools#possibleDownStreamProcessors(Workflow,Processor) */ public Set<Processor> getPossibleDownStreamProcessors() { return getTools().possibleDownStreamProcessors(getParent(), this); }
/** * Get the control links that prevent this processor from running. Does not * judge whether they are <i>currently</i> blocking the processor. * * @return The list of control links blocking this processor. * @see Scufl2Tools#controlLinksBlocking(Processor) */ public List<BlockingControlLink> controlLinksBlocking() { return getTools().controlLinksBlocking(this); }
/** * Get the URI of this datalink relative to another workflow element. * * @return The relative URI. * @see URITools#relativeUriForBean(WorkflowBean,WorflowBean) */ public URI getRelativeURI(WorkflowBean relativeTo) { return getUriTools().relativeUriForBean(this, relativeTo); } }
/** * Get all the annotations that pertain to this control link. * * @return The collection of annotations. * @see Scufl2Tools#annotationsFor(Child) */ public Collection<Annotation> getAnnotations() { return getTools().annotationsFor(this); }