Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-8330

Subflow does not receive the action data but the full parent data set

    • False
    • None
    • False
    • ---
    • ---
    • 2022 Week 50-02 (from Dec 12), 2023 Week 03-05 (from Jan 16)

      From the spec: https://github.com/serverlessworkflow/specification/blob/0.8.x/specification.md#Action-data-filters

       

      Each referenced workflow receives the SubFlow actions data as workflow data input.

      In the attached reproducer, a forEach state triggers a subFlow.

      Foreach definition includes iterationParam: name of the iteration parameter that can be referenced in actions/workflow. For each parallel iteration, this param should contain an unique element of the inputCollection array.

      So far, the action data contains the collection item mapped with the param name.

      In the reproducer, I expect that for each iteration the action data contains an element of names assigned to name, then the subflow is triggered with name initialized accordingly.

       

      Step to reproduce:

       

      1. Trigger the parent process with the following command

       

      curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{ "workflowdata": { "names": ["Donato", "Rachid"]}}' http://localhost:8080/foreach_parent
      

      2. From the log it's possible to see that the subflow contains the parent data but not the action data:

       

      2022-12-06 15:17:04,248 INFO  [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (executor-thread-0) Starting workflow 'foreach_child' (94a557ca-848f-4665-93ce-9511e0f8f9b1)
      2022-12-06 15:17:04,248 INFO  [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (executor-thread-0) Workflow data 
      {
        "names" : [ "Donato", "Rachid" ]
      } 
      

      Another suspect message in the log:

       

      2022-12-06 15:17:04,251 ERROR [org.jbp.wor.ins.imp.NodeInstanceImpl] (executor-thread-0) Could not find variable For Each_5
      2022-12-06 15:17:04,251 ERROR [org.jbp.wor.ins.imp.NodeInstanceImpl] (executor-thread-0) Using process-level scope
      2022-12-06 15:17:04,251 ERROR [org.jbp.wor.ins.imp.NodeInstanceImpl] (executor-thread-0) Could not find variable For Each_5
      2022-12-06 15:17:04,251 ERROR [org.jbp.wor.ins.imp.NodeInstanceImpl] (executor-thread-0) Using process-level scope
      

       

       

              ftirados Francisco Javier Tirado Sarti
              dmarrazz@redhat.com Donato Marrazzo
              Marian Macik Marian Macik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: