Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Fix timeline not show when using the DO_WHILE loop.#3682

Merged
v1r3n merged 1 commit intoNetflix:mainfrom
ppolxda:merge
Jul 23, 2023
Merged

Fix timeline not show when using the DO_WHILE loop.#3682
v1r3n merged 1 commit intoNetflix:mainfrom
ppolxda:merge

Conversation

@ppolxda
Copy link
Contributor

@ppolxda ppolxda commented Jul 5, 2023

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew generateLock saveLock to refresh dependencies)
  • WHOSUSING.md
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR

See the error we are seeing in the UI below

img_v2_7021dc82-dbd0-4416-a155-49341ecdddbg

The cause of the problem is that the Switch nodes and Fork nodes are not in Do-While list.

img_v2_be88270d-714a-4648-ad2a-9da76fc5b4cg

image

Click to see, Workflow Definitions

We can hide anything, even code!

{
  "createTime": 1687948608035,
  "updateTime": 1687949526700,
  "accessPolicy": {},
  "name": "loop_and_switch",
  "description": "loop_and_switch",
  "version": 7,
  "tasks": [
    {
      "name": "Loop Task",
      "taskReferenceName": "LoopTask",
      "inputParameters": {
        "value": "${workflow.input.value}"
      },
      "type": "DO_WHILE",
      "startDelay": 0,
      "optional": false,
      "asyncComplete": false,
      "loopCondition": "if ( ($.LoopTask['iteration'] < $.value ) ) { true; } else { false; }",
      "loopOver": [
        {
          "name": "switch_task",
          "taskReferenceName": "switch_task",
          "inputParameters": {
            "switchCaseValue": "${workflow.input.service}"
          },
          "type": "SWITCH",
          "decisionCases": {
            "fedex": [
              {
                "name": "Set_Name_2",
                "taskReferenceName": "Set_Name_2",
                "inputParameters": {
                  "name": "b"
                },
                "type": "SET_VARIABLE",
                "startDelay": 0,
                "optional": false,
                "asyncComplete": false
              }
            ],
            "ups": [
              {
                "name": "Set_Name_3",
                "taskReferenceName": "Set_Name_3",
                "inputParameters": {
                  "name": "c"
                },
                "type": "SET_VARIABLE",
                "startDelay": 0,
                "optional": false,
                "asyncComplete": false
              }
            ]
          },
          "defaultCase": [
            {
              "name": "Set_Name_1",
              "taskReferenceName": "Set_Name_1",
              "inputParameters": {
                "name": "a"
              },
              "type": "SET_VARIABLE",
              "startDelay": 0,
              "optional": false,
              "asyncComplete": false
            }
          ],
          "startDelay": 0,
          "optional": false,
          "asyncComplete": false,
          "evaluatorType": "value-param",
          "expression": "switchCaseValue"
        },
        {
          "name": "fork_join",
          "taskReferenceName": "my_fork_join_ref",
          "inputParameters": {},
          "type": "FORK_JOIN",
          "forkTasks": [
            [
              {
                "name": "Set_Name_4",
                "taskReferenceName": "Set_Name_4",
                "inputParameters": {
                  "fork": "a"
                },
                "type": "SET_VARIABLE",
                "startDelay": 0,
                "optional": false,
                "asyncComplete": false
              }
            ],
            [
              {
                "name": "Set_Name_5",
                "taskReferenceName": "Set_Name_5",
                "inputParameters": {
                  "fork": "b"
                },
                "type": "SET_VARIABLE",
                "startDelay": 0,
                "optional": false,
                "asyncComplete": false
              }
            ]
          ],
          "startDelay": 0,
          "optional": false,
          "asyncComplete": false
        },
        {
          "name": "notification_join",
          "taskReferenceName": "notification_join_ref",
          "inputParameters": {},
          "type": "JOIN",
          "startDelay": 0,
          "joinOn": [
            "Set_Name_5",
            "Set_Name_4"
          ],
          "optional": false,
          "asyncComplete": false
        }
      ]
    }
  ],
  "inputParameters": [
    "service",
    "value"
  ],
  "outputParameters": {
    "data": "${get_population_data.output.response.body.data}",
    "source": "${get_population_data.output.response.body.source}"
  },
  "schemaVersion": 2,
  "restartable": true,
  "workflowStatusListenerEnabled": false,
  "ownerEmail": "example@email.com",
  "timeoutPolicy": "ALERT_ONLY",
  "timeoutSeconds": 0,
  "variables": {},
  "inputTemplate": {}
}

Alternatives considered

Describe alternative implementation you have considered

@v1r3n v1r3n merged commit f4c95a4 into Netflix:main Jul 23, 2023
@ppolxda ppolxda deleted the merge branch July 24, 2023 04:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants