Package org.data2semantics.platform.domain

Examples of org.data2semantics.platform.domain.Domain


      String moduleName = (String) module.get("name");
      String source = (String) module.get("source");

      // Default domain
      Domain domain;
      String domainPrefix, sourceTail;
     
      if(! source.contains(":"))
      {
        domain = Global.defaultDomain();
        domainPrefix = "java";
        sourceTail = source;
      } else
      {
        domainPrefix = source.split(":")[0];
        sourceTail = source.split(":", 2)[1];
       
        if(! Global.domainExists(domainPrefix))
          throw new RuntimeException("Domain "+domainPrefix+" is not known");
       
        domain = Global.domain(domainPrefix);
      }

      // get name
      builder.module(moduleName, domain);

      // get the source
      builder.source(moduleName, sourceTail);

      // get the inputs
      Map inputMap = (Map) module.get("inputs");
     
      // Get the coupled inputs
      List<?> couples = (List <?>) module.get("couple");
   
     
      List<String> errors = new ArrayList<String>();
     
      if(!domain.validate(source, errors)){
        throw new InconsistentWorkflowException(errors);
      }
     
      parseInputAndCouples(builder, moduleName, domain, sourceTail, inputMap, couples);
     
      // ask the domain object for the outputs
      Map<String, DataType> outputTypeMap = getOutputTypes(source, domain);
     
      for(String outputName : outputTypeMap.keySet())
      {
        boolean print = domain.printOutput(sourceTail, outputName);

        String description = domain.outputDescription(sourceTail, outputName);
        builder.output(moduleName, outputName, description, outputTypeMap.get(outputName), print);
      }
    }
   
    return builder.workflow();
View Full Code Here


       
        ModuleImpl module = workflow.modules.get(moduleName),
                   refModule = workflow.modules.get(refModuleName);
       
        Output refOutput = refModule.output(refOutputName);
        Domain inputDomain = module.domain();
     
        DataType outputType = refOutput.dataType();
        module.addRefInput(inputName, description, refOutput, type, false, print);
       
        if(inputDomain.typeMatches(refOutput, module.input(inputName))){
          // Single reference input case
          ((ReferenceInput) module.input(inputName)).setMultiValue(false);
         
        } else
        if(isList(outputType)){
View Full Code Here

TOP

Related Classes of org.data2semantics.platform.domain.Domain

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.