Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Switch not working as per document #36

Open
bappctl opened this issue May 3, 2019 · 0 comments
Open

Switch not working as per document #36

bappctl opened this issue May 3, 2019 · 0 comments

Comments

@bappctl
Copy link

bappctl commented May 3, 2019

Issue:
Switch/Cases never executes "default" block.

Created below pipeline. On executing Switch Cases, when "year" value is not 2019 or 2020 it NEVER reaches Default block to set respective value to "output" variable, and the coordinator status always comes FAILED

2019-05-03 22:27:28.001 DEBUG 20812 --- [cTaskExecutor-1] c.c.piper.core.event.LogEventListener : {jobId=a9cabddd12f3469d9c68505fc7da6428, createTime=2019-05-04T05:27:27.993+0000, id=5097b47a74204e38af03b181fdd1cd9b, type=job.status, status=FAILED}

Request:

{
"pipelineId":"myswitch",
"inputs":
{
"year":"2019"
}
}

Response:

{
"createTime": "2019-05-04T05:27:27.490+0000",
"webhooks": [],
"inputs": {
"year": "2090"
},
"id": "a9cabddd12f3469d9c68505fc7da6428",
"label": "Switch",
"priority": 0,
"pipelineId": "switch2",
"status": "CREATED",
"tags": []
}

switch2.yaml

label: Switch

inputs:
  - name: year
    type: string
    required: true
    
tasks:          

  - name: selector
    type: var
    value: ${year}

  - type: switch
    expression: ${selector}
    cases: 
      - key: "2019"
        tasks: 
          - name: output
            type: var
            value: Requested this year ${selector} schedule 
      - key: "2020"
        tasks: 
          - name: output
            type: var
            value: Requested next year ${selector} schedule 
    default: 
          -  name: output
             type: var
             value: Schedule not available for year ${selector}
             
  - type: print
    label: ${selector}-${output}
    text: ${output}  

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant