Can medatada be filtered with workflow transitions?

Hey everyone,

I am currently trying to sort different documents according to their geographical location to give access or not to an group. (I m using Mayan EDMS 4.3.1)

To do this, I am using a metadata “area” which is for example “area1” and “area2”.

In my workflow, I created 2 states, one for each metadata and the permission to the group. This is working.

Now my problem is to automate the transition between the default state “undefined-area” to the area state according to the metadata.

So I selected “Metadata added” and “Metadata changed” as triggers and it works BUT it doesn’t make the dfference between the two metadata.

Here is my condition in the transition action from the workflow :

{% if document.metadata_value_of.area == “area1” %}
{% else %}
{% endif %}

This filter always put the state to “area1” even the metadata isn’t “area1”.
So I may have used the wrong syntax or filter, but with others it just didn’t change the state.

How can I make it work, is it at least possible?
As I said it is maybe just the wrong condition but I dont know.


After many tests, we found out how to do that!

The correct syntax is:

{% if workflow_instance.document.metadata_value_of.metadata-name == “Example” %} True {% else %}
{% endif %}

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.