public void evaluateStepDependenciesOrOutputsParameters(
      Map<String, Map<String, Object>> allStepOutputData,
      Map<String, Parameter> workflowParams,
      Map<String, Parameter> stepParams,
      Collection<List<MapParameter>> parameters,
      String stepId) {
    parameters.stream()
        .flatMap(Collection::stream)
        .forEach(v -> parseStepParameter(allStepOutputData, workflowParams, stepParams, v, stepId));
  }
@Test
  public void testEvaluateSignalParameters() {
    Map<String, ParamDefinition> paramDefMap = new LinkedHashMap<>();
    paramDefMap.put(
        "name", StringParamDefinition.builder().name("name").value("signal ${step1__foo}").build());
    paramDefMap.put(
        "bar",
        SignalParamDefinition.builder()
            .operator(SignalOperator.EQUALS_TO)
            .parameter(
                StringParamDefinition.builder().name("bar").value("test ${step1__foo}").build())
            .build());
    MapParamDefinition mapParamDefinition = MapParamDefinition.builder().value(paramDefMap).build();
    MapParameter mapParameter = (MapParameter) mapParamDefinition.toParameter();

    paramEvaluator.evaluateStepDependenciesOrOutputsParameters(
        Collections.emptyMap(),
        Collections.emptyMap(),
        Collections.singletonMap("foo", StringParameter.builder().name("foo").value("123").build()),
        Collections.singletonList(Collections.singletonList(mapParameter)),
        "step1");
    assertEquals("test 123", mapParameter.getEvaluatedParam("bar").getEvaluatedResult());
    assertEquals("signal 123", mapParameter.getEvaluatedParam("name").getEvaluatedResultString());

    paramDefMap = new LinkedHashMap<>();
    paramDefMap.put(
        "name", StringParamDefinition.builder().name("name").value("signal ${foo}").build());
    paramDefMap.put(
        "bar",
        SignalParamDefinition.builder()
            .operator(SignalOperator.EQUALS_TO)
            .parameter(StringParamDefinition.builder().name("bar").value("test ${foo}").build())
            .build());
    mapParamDefinition = MapParamDefinition.builder().value(paramDefMap).build();
    mapParameter = (MapParameter) mapParamDefinition.toParameter();

    paramEvaluator.evaluateStepDependenciesOrOutputsParameters(
        Collections.emptyMap(),
        Collections.emptyMap(),
        Collections.singletonMap("foo", StringParameter.builder().name("foo").value("123").build()),
        Collections.singletonList(Collections.singletonList(mapParameter)),
        "step1");
    assertEquals("test 123", mapParameter.getEvaluatedParam("bar").getEvaluatedResult());

    paramDefMap = new LinkedHashMap<>();
    paramDefMap.put(
        "name", StringParamDefinition.builder().name("name").value("signal123").build());
    paramDefMap.put(
        "bar",
        SignalParamDefinition.builder()
            .operator(SignalOperator.EQUALS_TO)
            .parameter(StringParamDefinition.builder().name("bar").value("test12").build())
            .build());
    mapParamDefinition = MapParamDefinition.builder().value(paramDefMap).build();
    mapParameter = (MapParameter) mapParamDefinition.toParameter();

    paramEvaluator.evaluateStepDependenciesOrOutputsParameters(
        Collections.emptyMap(),
        Collections.emptyMap(),
        Collections.singletonMap("foo", StringParameter.builder().name("foo").value("123").build()),
        Collections.singletonList(Collections.singletonList(mapParameter)),
        "step1");
    assertEquals("test12", mapParameter.getEvaluatedParam("bar").getEvaluatedResult());
    assertEquals("signal123", mapParameter.getEvaluatedParam("name").getEvaluatedResult());

    paramDefMap = new LinkedHashMap<>();
    paramDefMap.put(
        "name", StringParamDefinition.builder().name("name").expression("'signal' + foo").build());
    paramDefMap.put(
        "bar",
        SignalParamDefinition.builder()
            .operator(SignalOperator.EQUALS_TO)
            .parameter(
                StringParamDefinition.builder().name("bar").expression("'test' + foo").build())
            .build());
    mapParamDefinition = MapParamDefinition.builder().value(paramDefMap).build();
    mapParameter = (MapParameter) mapParamDefinition.toParameter();

    paramEvaluator.evaluateStepDependenciesOrOutputsParameters(
        Collections.emptyMap(),
        Collections.emptyMap(),
        Collections.singletonMap("foo", StringParameter.builder().name("foo").value("123").build()),
        Collections.singletonMap(StepDependencyType.SIGNAL, Collections.singletonList(mapParameter))
            .values(),
        "step1");
    assertEquals("test123", mapParameter.getEvaluatedParam("bar").getEvaluatedResult());
    assertEquals("signal123", mapParameter.getEvaluatedParam("name").getEvaluatedResult());

    paramDefMap = new LinkedHashMap<>();
    paramDefMap.put("name", StringParamDefinition.builder().name("name").expression("foo").build());
    paramDefMap.put(
        "bar",
        SignalParamDefinition.builder()
            .operator(SignalOperator.EQUALS_TO)
            .parameter(StringParamDefinition.builder().name("bar").expression("foo").build())
            .build());
    mapParamDefinition = MapParamDefinition.builder().value(paramDefMap).build();
    mapParameter = (MapParameter) mapParamDefinition.toParameter();

    paramEvaluator.evaluateStepDependenciesOrOutputsParameters(
        Collections.emptyMap(),
        Collections.emptyMap(),
        Collections.singletonMap("foo", StringParameter.builder().name("foo").value("123").build()),
        Collections.singletonList(Collections.singletonList(mapParameter)),
        "step1");
    assertEquals("123", mapParameter.getEvaluatedParam("bar").getEvaluatedResult());
    assertEquals("123", mapParameter.getEvaluatedParam("name").getEvaluatedResult());
  }