Skip to main content
Version: Next

Marking Stores

The workflow engine supports several marking store types for persisting the current places of a subject.

state_table (default)​

The default marking store. Place information is stored in the element_workflow_state table. Use this for assets and documents. For data objects, the other marking store options store data directly in the data object model as attributes.

The place is written to the table as soon as a transition is applied. There is one exception: when a transition with changePublishedState: save_version is applied through the workflow manager (Manager::applyWithAdditionalData() with $saveSubject = true, which is how Pimcore Studio applies transitions), only a draft (version) of the element is saved, so the new place is kept with the draft and is written to the table once the draft gets published. Discarding the draft discards the place change as well, just like it does with the attribute based marking stores below. Consumers reading the element_workflow_state table directly (workflow reports, the workflow filter of the search index, ...) therefore see the state of the published element while such a draft exists.

Transitions applied directly via $workflow->apply(), or through the manager without letting it save the subject ($saveSubject = false), write the place to the table immediately regardless of their changePublishedState: a custom caller that saves a draft itself must not expect the draft's place to be kept out of the table.

Configuration Example​
   marking_store:
type: state_table

single_state​

Stores the place in an attribute of the subject (calls the setter method). Use this when a model cannot occupy more than one place at the same time. This is the default single_state marking store provided by the Symfony framework. For data objects, a select field (or input field) is the right Pimcore field to store places with the single_state marking store.

Configuration Example​
   marking_store:
type: single_state
arguments:
- workflowState

multiple_state​

Same as single_state but supports multiple simultaneous places. This cannot be used with data object multiselect fields - use data_object_multiple_state instead.

Configuration Example​
   marking_store:
type: multiple_state
arguments:
- workflowState

data_object_multiple_state​

Stores multiple places in a data object multiselect field.

Configuration Example​
   marking_store:
type: data_object_multiple_state
arguments:
- workflowState

data_object_splitted_state (data objects only)​

Works like single_state and data_object_multiple_state but stores different places in different data object attributes. Configure a mapping between places and attribute names.

Configuration Example​

In the following example, text-related places are stored in workflowStateText while image-related places are stored in workflowStateImages:

   marking_store:
type: data_object_splitted_state
arguments:
- text_open: workflowStateText
text_finished: workflowStateText
text_released: workflowStateText

images_open: workflowStateImages
images_finished: workflowStateImages
images_released: workflowStateImages

Options provider (for single_state, data_object_multiple_state and data_object_splitted_state)​

When using data object attributes (select or multiselect) to store places, set up @pimcore.workflow.place-options-provider as options provider and the workflow name as options provider data in the data object attribute.

Options ProviderOptions ProviderOptions Provider

This options provider adds the places in a nicely formatted way: Options Provider Select ExampleOptions Provider Select ExampleOptions Provider Select Example