convert the json workflow to text
(self, workflow_json)
| 29 | return response |
| 30 | |
| 31 | def _json2txt(self, workflow_json): |
| 32 | ''' convert the json workflow to text''' |
| 33 | def json2text_step(step): |
| 34 | step_res = "" |
| 35 | step_res += step["stepId"] + ": [" + step["stepName"] + "]" |
| 36 | step_res += "[" + step["stepDescription"] + "][" |
| 37 | for jump in step["jumpLogic"]: |
| 38 | step_res += "[[" + jump["Condition"] + "][" + jump["Target"] + "]]," |
| 39 | step_res += "]\n" |
| 40 | return step_res |
| 41 | |
| 42 | workflow_txt = "" |
| 43 | for step in json.loads(workflow_json): |
| 44 | workflow_txt += json2text_step(step) |
| 45 | for substep in step['extension']: |
| 46 | workflow_txt += json2text_step(substep) |
| 47 | return workflow_txt |
no outgoing calls
no test coverage detected