Utility code for debugging your flow services

Hi All,

When we try to debug flow services we use the below services:

WmPublic/pub.flow:savePipelineToFile
WmPublic/pub.flow:restorePipelineFromFile

We usually disable and enable the above services while debugging the flow logic. I think this is not a good practice :lol:

And also we have a flow step properties called pipeline debug in wM 8.2 and above (you can still use that if you wish)

Here is a very simple sample code that can be used for debugging.

Note: Make sure you pass the same fileName as input to savePipelineToFile and restorePipelineFromFile

input: debug
ouput: NA

Flow logic:

Branch on /debug:
$null: pub.flow.restorePipelineFromFile
$default: pub.flow.savePipelineToFile

PFA screen shot;

Let me know if anyone has questions :lol:

Before you move your code to PROD make sure you remove this lines of code.

No need to do add this code. Just save pipeline will do. you can restore the pipeline at runtime by right click–restore from local/server under result tab… :smiley:

1 Like

Hi,

we have created a Service saveOrRestorePipeline for this.
The service uses property files to control if the feature is enabled or disabled at all.

Each project which uses this service is able to disable the feature for its own scope (mainly used in production) or to save the pipelines (default for dev and test). This is also handled by property files (project specific).

Due to this it is always possible to capture the data whenever needed by modifying property files only without the requirement to modify the real code.

Regards,
Holger

Yes I know its also a way to do it :smiley: . And also from version 8.2 you can use pipeline debug propertry for debuging flow service.

And also thanks for reading and commenting.

In some case, pipeline debug property doesn’t work. The service is executed definitely, but pipeline is not saved. :smiley: