Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Error msg while creating and attaching a pdf to the WO



Can't useFlow Activity, ‘pyAttachAsPDF’. Errors are showing.

Error Messages

Save, Delete or Commit has failed because lock “<class-name> <Work-ID>” is not held.

Steps to Reproduce

Create a Utility Activity which calls ‘pyAttachAsPDF’ ; reference this Utility from within a Flow.

Root Cause

A defect in Pegasystems’ code or rules.

The ‘pyAttachAsPDF’ Activity calls another Activity called ‘Code-Pega-PDF.AttachToWork’ which contains several Steps which perform either a COMMIT or have the ‘WriteNow’ flag checked.

These Steps interfere with PRPC’s automatic COMMIT handling when running within the context of a Flow.


The recommended apporach is to upgrade to the latest Maintenance Release of PRPC7: the Activity ‘Code-Pega-PDF.AttachToWork’ was enhanced to take an extra Parameter called ‘SkipCommit’.

If upgrading is not an option:

It is also possible to make a local copy of the (non-Final) Activity ‘Code-Pega-PDF.AttachToWork’ to add this 'SkipCommit' Parameter and implement the same behaviour (using Pre-Condition When Rules) to skip the Commit Steps.

However: In order to save a copy of 'AttachToWork' , it is necessary to temporarily disable the Validation Rules - as the Designer Studio will not allow a new version of the Rule to be saved (due to a clash in Property Names/Declarative Targets).


Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us