OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Get workflowItemId for entity via API

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

    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 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #24828
    Yevhen Shyshkin
    Yevhen Shyshkin
    Participant

    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. :)

    #24829

    Nikita Petrov
    Participant

    Yevhen, thank you. I will try.

    #24830

    roldan
    Participant

    Hi,

    Is there any news about getting workflowItem and workflowStep through API?
    I’m using ApiEntityManager::getSerializationConfig() to set the fields that cget will return but cannot add workflowItem there because I get 500 error.

    Thanks,
    Matias

    #24831

    mfejczaruk
    Participant

    Hello,
    Please provide logs and environment information so we can see where’s the problem.
    Best regards

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

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

You will be redirected to [title]. Would you like to continue?

Yes No