Closed raghumb closed 7 months ago
I saw that I was parsing json object instead of string. Below code is correct way. Closing this. const expected =fs.readFileSync('req.json', 'utf8'); const workflow: Specification.Workflow = Specification.Workflow.fromSource(expected); console.log(workflow.id)
What happened: Getting undefined error while printing attributes of workflow object.
What you expected to happen: workflow attributes should be fetched.
How to reproduce it: npm i @severlessworkflow/sdk-typescript import { Specification } from '@severlessworkflow/sdk-typescript';
json file contents: https://github.com/serverlessworkflow/sdk-typescript/blob/3.0.x/tests/examples/applicantrequest.json const expected = JSON.parse(fs.readFileSync('req.json', 'utf8')); const workflow: Specification.Workflow = Specification.Workflow.fromSource(expected); console.log(workflow.id)
Anything else we need to know?:
Environment: macOS Monterey