ssossossossosso

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 2 years, 6 months ago.

  • Creator
    Topic
  • #28409

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

    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

    #28411

    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)
    {
    ...
    }

    #28412

    Alexander
    Participant

    Hi.

    Just create a task like this:

    and then call the method:

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

You must be logged in to reply to this topic.