OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Create Entity with activityManager in Workflow?

This topic contains 3 replies, has 3 voices, and was last updated by  Alexander 8 years, 9 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
  • #33890

    cardiac
    Participant

    Hi,

    I want to create a task inside a workflow but don’t know how, because I think I need the activity manager?!

    Can you give me an example on how to do it?
    Perhaps it’s doable with a “create_entity” configuration…

    Thanks and

    regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #33891

    cardiac
    Participant

    I just wrote an CreateActivityEntity workflow action. Don’t know if it’s best practice but works for me.

    If somebody of you (especially the core devs is interested in this feature, I will add it to the WorkflowBundle with a PR

    #33892

    Yevhen Shyshkin
    Participant

    Hello, cardiac.

    > I just wrote an CreateActivityEntity workflow action. Don’t know if it’s best practice but works for me.
    It’s quite good solution for this case.

    Another solution is to use internal function addActivityTarget (you can find this code at entity cache):

    /**
    * Associates the given entity with this entity
    *
    * @param object $target Any configurable entity that can be associated with this type of entity
    * @return object This object
    */
    public function addActivityTarget($target)
    {
    ...
    }

    #33893

    Alexander
    Participant

    Hi.

    Just create a task like this:

    and then call the method:

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

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

Back to top