# Support workflows on documents that are not hippostdpubwf:document in the WorkflowPersistenceManagerImpl

**URL:** <https://community.bloomreach.com/t/support-workflows-on-documents-that-are-not-hippostdpubwf-document-in-the-workflowpersistencemanagerimpl/2752>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [August 29, 2021, 7:35pm UTC](https://community.bloomreach.com/t/support-workflows-on-documents-that-are-not-hippostdpubwf-document-in-the-workflowpersistencemanagerimpl/2752 "2021-08-29T19:35:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwgmeligmeyling](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jwgmeligmeyling/32/1077_2.png) [@jwgmeligmeyling](https://community.bloomreach.com/u/jwgmeligmeyling)\
**Post date:** [August 29, 2021, 7:35pm UTC](https://community.bloomreach.com/t/support-workflows-on-documents-that-are-not-hippostdpubwf-document-in-the-workflowpersistencemanagerimpl/2752/1 "2021-08-29T19:35:37Z")

</div>

Currently the `WorkflowPersistenceManagerImpl` is tightly coupled with publishable documents and thus the `DocumentWorkflow` and the `hippostdpubwf:document` document types. This renders the `WorkflowPersistenceManagerImpl` useless for the purpose of invoking workflows on documents that are not of the type `hippostdpubwf:document`.

It should be noted that the `DocumentWorkflow` is _not_ actually intended for invoking workflow operations on any document, which could also be an asset or an image. Rather, the `DocumentWorkflow` implements the [“Document workflow”](https://documentation.bloomreach.com/14/library/concepts/workflow/document-workflow.html) for publishable documents and is tailored specifically towards that workflow. “Simple documents”, like images and assets, have their own respective workflow implementations.

It currently is not possible to use the `WorkflowPersistenceManager` to invoke workflows on custom simple documents.

In “[HSTTWO-2837](https://issues.onehippo.com/browse/HSTTWO-2837) Non-publishable documents created by workflow remain in preview” Jeroen also questioned this coupling between the WPM and publishable documents:

> I’m not so sure about the functional contract between WorkflowPersistenceManager and hippostdpubwf:document since it just triggers (repository) workflows which can be anything. If there is a contract, it’s really hidden and implicit.

Unfortunately, this comment was not followed upon. It does show however, that at the time, it was possible to use the `WorkflowPersistenceManager` to save non-publishable documents. And after the fix for [~~HSTTWO-2837~~](https://issues.onehippo.com/browse/HSTTWO-2837) it was even possible for these documents to be automatically be published (as even non-publishable documents need a “live” availability status to become visible).

However, this was then later reverted in [~~HSTTWO-4686~~](https://issues.onehippo.com/browse/HSTTWO-4686) by Ard. Since this change, the `WorkflowPersistanceManagerImpl` relies on the document workflow to update the availability status (through `((DocumentWorkflow)docWf).commitEditableInstance())`. Casting to `DocumentWorkflow` instead of `EditableWorkflow` effectively broke the use-case the `WorkflowPersistenceManager` had for non-publishable documents.

I think there is a valid use case for the `WorkflowPersistenceManagerImpl` to be able to invoke any Workflow on any document type, and not tie this to the document workflow for publishable documents. The two aspects that broke support for non-publishable documents can easily be addressed in the `WorkflowPersistenceManagerImpl`.

WDYT? Should this be addressed in `WorkflowPersistenceManagerImpl`, or should users working with custom simple document workflows be expected to implement their own `WorkflowPersistenceManager`?

---

<div class="post-metadata">

**Author:** ![Henriette\_Metz](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/henriette_metz/32/1160_2.png) [@Henriette\_Metz](https://community.bloomreach.com/u/Henriette_Metz)\
**Post date:** [July 13, 2022, 11:37am UTC](https://community.bloomreach.com/t/support-workflows-on-documents-that-are-not-hippostdpubwf-document-in-the-workflowpersistencemanagerimpl/2752/2 "2022-07-13T11:37:00Z")

</div>

Hi,  
did you implement a custom workflow persistence manager? Did you adapt the process for writing images?  
KR  
Henriette
