Collection<Entity> getParticipants(PathwayStep step) { // this is a protection from an infinite loop //(which normally should never occur; another rule will check that.) Collection<Process> processes = new HashSet<Process>(); Set<Entity> ret = new HashSet<Entity>(); if(step instanceof BiochemicalPathwayStep) { Conversion c = ((BiochemicalPathwayStep) step).getStepConversion(); ret.addAll( getParticipants(c, processes) ); } for(Process p : step.getStepProcess()) { ret.addAll( getParticipants(p, processes) ); } return ret; }
Collection<Entity> getParticipants(PathwayStep step) { // this is a protection from an infinite loop //(which normally should never occur; another rule will check that.) Collection<Process> processes = new HashSet<Process>(); Set<Entity> ret = new HashSet<Entity>(); if(step instanceof BiochemicalPathwayStep) { Conversion c = ((BiochemicalPathwayStep) step).getStepConversion(); ret.addAll( getParticipants(c, processes) ); } for(Process p : step.getStepProcess()) { ret.addAll( getParticipants(p, processes) ); } return ret; }
public void check(PathwayStep step, boolean fix) { Pathway pathway = step.getPathwayOrderOf(); /* can be null, e.g., when the check is called * during a new PathwayStep is added to the model * but not yet assigned to any Pathway! This case is ignored. */ if (pathway != null) { Set<Process> pathwayComponents = pathway.getPathwayComponent(); for (Process stepProcess : step.getStepProcess()) { if (!pathwayComponents.contains(stepProcess)) { error(step, "component.not.found", false, stepProcess, pathway); } } } }
public void check(final Validation validation, PathwayStep step) { Pathway pathway = step.getPathwayOrderOf(); /* can be null, e.g., when the check is called * during a new PathwayStep is added to the model * but not yet assigned to any Pathway! This case is ignored. */ if (pathway != null) { Set<Process> pathwayComponents = pathway.getPathwayComponent(); for (Process stepProcess : step.getStepProcess()) { if (!pathwayComponents.contains(stepProcess)) { error(validation, step, "component.not.found", false, stepProcess, pathway); } } } }