// Looks at all tables involved in the mapping and returns a list of output keys that could be created. This also includes the output keys // used in the inclusion and exclusion tables if any. The outputs from each mapping will only be included if it passes the inclusion/exclusion // criteria based on the context. // @param mapping a StagingMapping // @param context a context of values used to to check mapping inclusion/exclusion // @return a Set of unique output keys public HashSet <String> getOutputs(StagingMapping mapping, Dictionary <String, String> context) { HashSet <String> outputs = new HashSet <String>(); if (mapping.getTablePaths() != null) { if (context == null || _engine.isMappingInvolved(mapping, context)) { outputs.UnionWith(_engine.getOutputs(mapping)); } } return(outputs); }
// Looks at all tables involved in the mapping and returns a list of input keys that could be used. This always includes the input keys // used in the inclusion and exclusion tables if any. The inputs from each table path will only be included if it passes the inclusion/exclusion // criteria based on the context. // @param mapping a StagingMapping // @param context a context of values used to to check mapping inclusion/exclusion // @param excludedInputs a list of input keys to not consider as inputs // @return a Set of unique input keys public HashSet <String> getInputs(StagingMapping mapping, Dictionary <String, String> context, HashSet <String> excludedInputs) { HashSet <String> inputs = new HashSet <String>(); // the inclusion tables are always evaluated so any inputs there should be added always if (mapping.getInclusionTables() != null) { foreach (StagingTablePath path in mapping.getInclusionTables()) { inputs.UnionWith(getInputs(path, excludedInputs)); } } // the exclusion tables are always evaluated so any inputs there should be added always if (mapping.getExclusionTables() != null) { foreach (StagingTablePath path in mapping.getExclusionTables()) { inputs.UnionWith(getInputs(path, excludedInputs)); } } // if there are tables paths and if the mapping is involved, add the inputs if (mapping.getTablePaths() != null) { if (context == null || _engine.isMappingInvolved(mapping, context)) { inputs.UnionWith(_engine.getInputs(mapping, excludedInputs)); } } // always remove all context variables since they are never needed to be supplied inputs.ExceptWith(CONTEXT_KEYS); return(inputs); }