Github user haouech commented on a diff in the pull request:
https://github.com/apache/incubator-taverna-language/pull/41#discussion_r208043243
--- Diff:
taverna-scufl2-api/src/main/java/org/apache/taverna/scufl2/api/common/Scufl2Tools.java
---
@@ -752,6 +753,30 @@ public Activity createActivityFromProcessor(Processor
processor,
return activity;
}
+ public Configuration createNestedRelationship(Processor processor,
Workflow childWorkflow, Profile profile) {
+ if(processor.getParent() == null) {
+ throw new IllegalStateException("Processor " +
processor + " has no parent");
+ }
+ if(processor.getParent().getParent() !=
childWorkflow.getParent()) {
+ throw new IllegalStateException(
+ "Processor " + processor + " and
workflow " + childWorkflow + " are not in the same Workflow bundle");
+ }
+ if(nestedWorkflowForProcessor(processor, profile) != null) {
--- End diff --
I see your point. I took advantage of the already thrown exceptions by the
'getActivity' method of Processor. Now we make sure that the processor has no
activity bound to it before nesting the workflows.
---