OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform How to add Entity as Context to Task in process.yml ?

This topic contains 2 replies, has 2 voices, and was last updated by  Mike Kudelya 7 years, 5 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
  • #36997

    dwittig
    Participant

    Heyho,

    I’m trying to create a new task when a Contact Address is Created or updated.
    So far I can create the Task, but now I want to add a Contact as Context to the Task.

    My code:
    definitions:
    add_Task_when_address_updates:
    label: 'Add Task When Address is Updated'
    enabled: true
    entity: OroCRM\Bundle\ContactBundle\Entity\ContactAddress
    order: 10
    actions_configuration:
    - '@tree':
    actions:
    - '@find_entity': #Find Task Priority Normal
    class: OroCRM\Bundle\TaskBundle\Entity\TaskPriority
    attribute: $.priority
    where:
    name: 'normal'
    - '@find_entity': #Find Task Status open
    class: Extend\Entity\EV_Task_Status
    attribute: $.task_step
    where:
    id: 'open'
    - '@format_string': #Build Subject String
    attribute: $.address_subject
    string: 'Verifizierung Stammdaten - %address_owner%'
    arguments:
    address_owner: $.data.owner
    - '@create_entity': #Create new Task
    class: OroCRM\Bundle\TaskBundle\Entity\Task
    attribute: $.task
    data:
    taskPriority: $.priority
    status: $.task_step
    subject: $.address_subject
    description: 'Es wurde die Adresse geändert. Bitte prüfen Sie die Nationalität.'
    - '@unset_value': [$.task]
    triggers:
    add_Task_when_address_updates:
    -
    event: create
    priority: 10
    queued: false
    -
    event: update
    priority: 10
    queued: false

    So does Anyone know how to add a Context when you create a task with process.yml?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #36998

    dwittig
    Participant

    I found this solution:

    - '@call_method':
    object: $.task # task object calls method
    method: addActivityTarget # addActivityTarget adds Entity to task object
    method_parameters:
    [$.entity] # 'entity' is added as Context to task

    #36999

    Mike Kudelya
    Participant

    Hi

    Try to use:

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

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

Back to top