package io.cloudslang.lang.compiler.validator;

import io.cloudslang.lang.compiler.modeller.result.ExecutableModellingResult;
import io.cloudslang.lang.compiler.modeller.transformers.InOutTransformer;
import io.cloudslang.lang.compiler.modeller.transformers.Transformer;
import io.cloudslang.lang.compiler.parser.model.ParsedSlang;
import io.cloudslang.lang.entities.bindings.InOutParam;
import io.cloudslang.lang.entities.bindings.Result;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * User: bancl
 * Date: 6/17/2016
 */
public interface PreCompileValidator {

    String validateExecutableRawData(ParsedSlang parsedSlang, Map<String, Object> executableRawData, List<RuntimeException> errors);

    public List<Map<String, Map<String, Object>>> validateWorkflowRawData(ParsedSlang parsedSlang, Object workflowRawData, String executableName, List<RuntimeException> errors);

    ExecutableModellingResult validateResult(ParsedSlang parsedSlang, String executableName, ExecutableModellingResult result);

    List<RuntimeException> checkKeyWords(
            String dataLogicalName,
            String parentProperty,
            Map<String, Object> rawData,
            List<Transformer> allRelevantTransformers,
            List<String> additionalValidKeyWords,
            List<List<String>> constraintGroups);

    Map<String, Map<String, Object>> validateOnFailurePosition(
            List<Map<String, Map<String, Object>>> workFlowRawData,
            String execName,
            List<RuntimeException> errors);

    void validateDecisionResultsSection(Map<String, Object> executableRawData, String artifact, List<RuntimeException> errors);

    List<RuntimeException> validateNoDuplicateInOutParams(List<? extends InOutParam> inputs, InOutParam element);

    void validateResultsHaveNoExpression(List<Result> results, String artifactName, List<RuntimeException> errors);

    void validateResultTypes(List<Result> results, String artifactName, List<RuntimeException> errors);

    void validateDefaultResult(List<Result> results, String artifactName, List<RuntimeException> errors);

    void validateResultName(String resultName);

    void validateStringValue(String name, Serializable value, InOutTransformer transformer);
}

@@ -728,23 +728,16 @@
 );%0A%0A    
-public 
 List%3CMap
@@ -2118,57 +2118,8 @@
 );%0A%0A
-    void validateResultName(String resultName);%0A%0A
     

handle merge conflicts