OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions How to run custom complex operations after workflow transition?

This topic contains 2 replies, has 2 voices, and was last updated by  Stepan Yudin 8 years, 5 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #36102

    Stepan Yudin
    Participant

    Good day everyone!

    I still can’t figure out the correct approach to handle complex operations at workflow transition.
    In fact, i need to pass current entity to some service when workflow step was changed

    I know about post_actions configuration but this feature allow to execute simple actions like find some entity and set relation with it.
    In my case i need to run really complex calculations (i need to calculate paid shipping for financial quarters)
    Can you give me advice, please


    Docker environment for Symfony2/OroCRM/OroBAP development on Windows platform
    https://github.com/stepansib/sf-oro-docker

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #36103

    Yevhen Shyshkin
    Participant

    Hello, Stepan.

    You should create your custom action, encapsulate all complex calculations inside it and run it in required post actions.

    How to do that:
    1) create action class that extends AbstractAction or implements ActionInterface (example)
    2) register this action in DI with oro_workflow.action tag and some unique alias that defines action name (example)
    3) put your action in init actions or post actions (example)
    4) reload worklfow configuration using CLI command oro:workflow:definitions:load

    #36104

    Stepan Yudin
    Participant

    Yevhen, thats it! Thanks, you saved a lot of my time! )


    Docker environment for Symfony2/OroCRM/OroBAP development on Windows platform
    https://github.com/stepansib/sf-oro-docker

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

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

Back to top