OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums OroPlatform OroPlatform – How do I? Questions Get specific workflow in datagrid

This topic contains 4 replies, has 2 voices, and was last updated by Andrey Yatsenko Andrey Yatsenko 1 year, 7 months ago.

  • Creator
    Topic
  • #36629

    nicolas.sinabs
    Participant

    Hello,

    I’m using Oro 2.6
    With 1.x versions of OroPlatform I was able to create columns for workflow steps in my datagrids like this :

    Since the evolution of WorkflowBundle this code doesn’t work, workflowStep is not defined on the entity.

    What is the equivalent in 2.6 version ?
    How can I filter on a specific workflow / steps in my datagrid ?

    Thank you !

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

    Hi Nicolas,

    In 2.6 instead of relation from workflow to an entity we have 2 columns at the “oro_workflow_item” table, it’s “entity_class” and “entity_id”.

    At the core, we have the listener that can show workflow step buttons for the Datagrid on entities that have a workflow attached, but your case little bit more complex as Datagrid build for OrderItem, but workflow attached to Order entity.
    Here is that listener I’m talking about
    https://github.com/oroinc/platform/blob/2.6.14/src/Oro/Bundle/WorkflowBundle/Datagrid/WorkflowStepColumnListener.php

    You can build your own Datagrid listener based on the above to attach workflow buttons to the OrderItem datagrid.

    #36632

    nicolas.sinabs
    Participant

    Hi Andrey,

    Thank you for your response.

    My need does not necessarily focus on the action buttons but on the filters I can apply to datagrids (where statement in my example)

    For example I want to create a datagrid for open orders (orders with “custom_order_workflow” started), archived orders (orders with “custom_order_workflow” at step “closed”) …

    #36633

    nicolas.sinabs
    Participant

    Hi Andrey,

    You were right, the WorkflowStepColumnListener class helped me to solve my problem.
    I redefined the applyFilter method :

    and now I can use the filters like this :

    Thank you again for your help !

    #36634
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Thank you for sharing the solution with the community!

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