ssossossossosso

Forums

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

This topic contains 4 replies, has 2 voices, and was last updated by  Rodolfo 2 years, 1 month ago.

  • Creator
    Topic
  • #28528

    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
  • #28529

    Dmitry Khrysev
    Participant

    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

    #28530

    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.

    #28531

    Dmitry Khrysev
    Participant

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

    #28532

    Rodolfo
    Participant

    Hi Dmitry,

    The solution using EventListeners worked.
    Thank you so much!

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

You must be logged in to reply to this topic.