OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums OroCRM OroCRM – How do I? Questions Show workflow based of entity field value

This topic contains 4 replies, has 2 voices, and was last updated by  Rick 3 months, 2 weeks ago.

  • Creator
    Topic
  • #40057

    Rick
    Participant

    Hello,

    is it possible to show a Workflow only if a value on the related Entity is matched?

    I.e. you have an Entity with a field “type”. Now you assign two different workflows
    to that entity. Now if “type” has a certain value we want to show Workflow 1, if it has another value we want to show Workflow 2.

    Best Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #40058
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Hi Rick,

    You can check that at preconditions for the start transaction to hide the buttons, like

    Also, take a look at exclusive_active_groups and priority to allow only one workflow of the group to be active
    https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/WorkflowBundle/Resources/doc/reference/workflow/configuration-reference.md

    #40069

    Rick
    Participant

    Hi Andrey,

    thank you for your quick reply.

    However if i just add the precondition the buttons are hidden but you can still see the workflow.
    When i set exclusive_active_groups only one workflow can be active (shown) no matter the precondition.

    It looks like its not doable without overwriting/adding custom code.

    Best Regards

    #40070
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    You are right, Rick.

    The information about available workflows is always shown out of the box. You have to customize the template or the function that pass data to the template.

    #40085

    Rick
    Participant

    I would like to add an additional WorkflowApplicabilityFilter whichs checks if a certain condition
    is met.

    Is there a way to extend the WorkflowConfiguration to add an additional node (entity_conditions)
    which i can set in the workflow.yml file like:

    Thanks for your help in advance

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No