list of available entities for workflow state action conditions

Questions, comments, discussions. Over time certain topics might be moved to their own category.
Post Reply
woec
Posts: 9
Joined: Sun Jun 02, 2019 7:11 am

list of available entities for workflow state action conditions

Post by woec »

Hi,

I search for a list of entities available for workflow state action conditions.
I want to act on a tag assigned to a document. I tried the following condition:

{% if workflow_instance.document.tag == "Rechnungen-ST" %}
{% endif %}

does not work ...

Best regards,
woec
User avatar
michael
Developer
Developer
Posts: 89
Joined: Sun Apr 19, 2020 6:21 am

Re: list of available entities for workflow state action conditions

Post by michael »

Hi,

The reason the template does not work is because workflow_instance.document.tag is not single variable but a queryset (a collection).

You have to filter the queryset. This is done by calling the filter method of the queryset and passing the property and value to look for.

Code: Select all

{% method workflow_instance.document.tags "filter" label="Rechnungen-ST" as tag_result %}{% if tag_result %}True{% endif %}
Also, the attribute to get the tags queryset is tags instead of tag.

Hope this helps.
Post Reply