private void createDataLinks(Draft3Workflow workflow) throws Draft3Exception {
  for (  Draft3OutputPort port : workflow.getOutputs()) {
    port.setId(Draft2ToDraft3Converter.convertPortID(port.getId()));
    List<String> sources=transformSource(port.getSource());
    for (int position=0; position < sources.size(); position++) {
      String destination=port.getId();
      LinkMerge linkMerge=port.getLinkMerge() != null ? LinkMerge.valueOf(port.getLinkMerge()) : LinkMerge.merge_nested;
      String source=sources.get(position);
      source=Draft2ToDraft3Converter.convertSource(source);
      source=Draft3SchemaHelper.normalizeId(source);
      Draft3DataLink dataLink=new Draft3DataLink(source,destination,linkMerge,position + 1);
      workflow.addDataLink(dataLink);
    }
  }
  for (  Draft3Step step : workflow.getSteps()) {
    step.setId(Draft2ToDraft3Converter.convertStepID(step.getId()));
    List<Draft3DataLink> dataLinks=new ArrayList<>();
    for (    Map<String,Object> input : step.getInputs()) {
      List<String> sources=transformSource(Draft3BindingHelper.getSource(input));
      for (int position=0; position < sources.size(); position++) {
        String destination=Draft3BindingHelper.getId(input);
        destination=Draft2ToDraft3Converter.convertDestinationId(destination);
        destination=step.getId() + SLASH_SEPARATOR + destination;
        LinkMerge linkMerge=Draft3BindingHelper.getLinkMerge(input) != null ? LinkMerge.valueOf(Draft3BindingHelper.getLinkMerge(input)) : LinkMerge.merge_nested;
        String source=sources.get(position);
        source=Draft2ToDraft3Converter.convertSource(source);
        source=Draft3SchemaHelper.normalizeId(source);
        Draft3DataLink dataLink=new Draft3DataLink(source,destination,linkMerge,position + 1);
        dataLinks.add(dataLink);
      }
    }
    workflow.addDataLinks(dataLinks);
  }
}

private void createDataLinks ( Draft3Workflow workflow ) throws Draft3Exception { for ( Draft3OutputPort port : workflow . getOutputs ( ) ) { port . setId ( Draft2ToDraft3Converter . convertPortID ( port . getId ( ) ) ) ; List < String > sources = transformSource ( port . getSource ( ) ) ; for ( int position = 0 ; position < sources . size ( ) ; position ++ ) { String destination = port . getId ( ) ; LinkMerge linkMerge = port . getLinkMerge ( ) != null ? LinkMerge . valueOf ( port . getLinkMerge ( ) ) : LinkMerge . merge_nested ; String source = sources . get ( position ) ; source = Draft2ToDraft3Converter . convertSource ( source ) ; source = Draft3SchemaHelper . normalizeId ( source ) ; Draft3DataLink dataLink = new Draft3DataLink ( source , destination , linkMerge , position + 1 ) ; workflow . addDataLink ( dataLink ) ; } } for ( Draft3Step step : workflow . getSteps ( ) ) { step . setId ( Draft2ToDraft3Converter . convertStepID ( step . getId ( ) ) ) ; List < Draft3DataLink > dataLinks = new ArrayList < > ( ) ; for ( Map < String , Object > input : step . getInputs ( ) ) { List < String > sources = transformSource ( Draft3BindingHelper . getSource ( input ) ) ; for ( int position = 0 ; position < sources . size ( ) ; position ++ ) { String destination = Draft3BindingHelper . getId ( input ) ; destination = Draft2ToDraft3Converter . convertDestinationId ( destination ) ; destination = step . getId ( ) + SLASH_SEPARATOR + destination ; LinkMerge linkMerge = Draft3BindingHelper . getLinkMerge ( input ) != null ? LinkMerge . valueOf ( Draft3BindingHelper . getLinkMerge ( input ) ) : LinkMerge . merge_nested ; String source = sources . get ( position ) ; source = Draft2ToDraft3Converter . convertSource ( source ) ; source = Draft3SchemaHelper . normalizeId ( source ) ; Draft3DataLink dataLink = new Draft3DataLink ( source , destination , linkMerge , position + 1 ) ; dataLinks . add ( dataLink ) ; } } workflow . addDataLinks ( dataLinks ) ; } }
created data links from source properties
