ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

Open-Source CRM software Forums OroCRM OroCRM – Programming Questions Get workflowItemId for entity via API

This topic contains 2 replies, has 2 voices, and was last updated by  Nikita Petrov 2 years, 6 months ago.

  • Creator
    Topic
  • #5475

    Nikita Petrov
    Participant

    To perform feedback from BPM to OroCRM I need to transit workflow item for opportunity entity to next step via api. To do this I need to know ID of workflow item associated with opportunity entity because of requirements of API method:

    /api/rest/{version}/workflow/transit/{workflowItemId}/{transitionName}

    To get workflow item ID I tried to get this information by call get opportunity method:

    /api/rest/{version}/opportunities/{id}

    For my test opportunity I’ve got this result (for debug I switched off WSSE authentication):

    Result of call says me that no workflow item associated with my opportunity entity, but I know that is not right:

    screenshot

    ID of associated workflow entity is 97. How can I get this via API to perform transit?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #5481
    Yevhen Shyshkin
    Yevhen Shyshkin
    Oro Core

    Hello, Nikita.

    Probably, there are no easy answer to your question. We need to refactor entities API so they return relation information (workflow item ID, workflow step ID etc), and need to create API method that will return workflow item information not only by workflow item ID, but also by class + identifier.

    For now you can implement your API method in your bundle to proxy WorkflowManager::getWorkflowItemByEntity into API. We would really appreciate if you’d do pull request to WorkflowBundle with this method. 🙂

    #5496

    Nikita Petrov
    Participant

    Yevhen, thank you. I will try.

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

You must be logged in to reply to this topic.