Github user stain commented on a diff in the pull request:

    
https://github.com/apache/incubator-taverna-language/pull/41#discussion_r208319161
  
    --- Diff: 
taverna-scufl2-api/src/test/java/org/apache/taverna/scufl2/api/common/TestScufl2Tools.java
 ---
    @@ -63,6 +64,25 @@ public void makeBundle() {
                makeWorkflowBundle();
                assertNotNull(workflowBundle);
        }
    +
    +   @Test
    +   public void testNestedWorkflows() {
    +           Workflow child = new Workflow();
    +           child.setName("childWorkflow");
    +           child.setParent(workflowBundle);
    +
    +           Workflow mainWorkflow = workflowBundle.getMainWorkflow();
    +           Processor processor = new Processor();
    +           processor.setParent(mainWorkflow);
    +
    +           Profile profile = workflowBundle.getMainProfile();
    +
    +           Scufl2Tools tools = new Scufl2Tools();
    +           tools.createNestedRelationship(processor, child, profile);
    +           Workflow nested = tools.nestedWorkflowForProcessor(processor, 
profile);
    +
    +           assertEquals(child, nested);
    --- End diff --
    
    Yeah, safely you should pick the correct activity based on the 
`ProcessorBinding` rather than picking blindly the first one with 
`NESTED_WORKFLOW` in it - although that will be the case for this particular 
test case profile as there should be no other activites.
    
    So perhaps improve it to look up the ProcessorBinding for the processor and 
from there find the activity and its configuration? Sorry it's a bit 
cumbersome..


---

Reply via email to