OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions @redirect in process.yml

This topic contains 4 replies, has 2 voices, and was last updated by  Rodolfo 8 years, 4 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
  • #34009

    Rodolfo
    Participant

    Hi there,

    Please I need some help here. I’m trying to redirect to a specific route or url after some logic inside a process.yml but I’m stuck on this error:

    PropertyAccessor requires a graph of objects or arrays to operate on, but it found type “NULL” while trying to traverse path “result.redirectUrl” at property “redirectUrl”.

    This string is being passed as argument thought this core action/service here: https://github.com/orocrm/platform/blob/ae09ef7175a0febc079b33d7a0b4d2ceab7cbc91/src/Oro/Bundle/WorkflowBundle/Resources/config/actions.yml#L128

    Do I need a $result attribute in my process.yml to make it work?

    This is my redirect. Also tried using route and nothing.

    - @redirect:
    url: 'http://google.com/'

    Do you guys have any clue?
    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #34010

    Hi, Rodolfo
    Redirect action may be used in scope of workflows, but processes are little bit different, as them may be executed by job queue in cli environment

    #34011

    Rodolfo
    Participant

    Hi @dkhrysev

    Thanks for your reply. My process.yml is being triggered when a new Lead is added. The problem is that depending of the way of the flow inside this process goes, it will remove the lead that was just added. If it remove the lead the final redirection goes to Lead/View it generates a 404 in the web view.

    I can’t put this process on job queue because I need the action executed right away.

    Is there a way to ignore this process.yml on User Interface and only enable it if the Lead is created through RESTApi?

    Thank you so much.

    #34012

    Possible solution is to add EventListener on kernel.response and handle redirection there dependent on entity existence.

    #34013

    Rodolfo
    Participant

    Hi Dmitry,

    The solution using EventListeners worked.
    Thank you so much!

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

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top