BPM: Howto access outputCollection from a multi instance sub process?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hi-ko
    Member
    • May 2015
    • 90

    BPM: Howto access outputCollection from a multi instance sub process?

    I would like to include in an email template the list of resolution, resolutionNote stored in a multi instance subprocess' outputCollection.
    I guess I need to first create a variable to store the required object but how could I access the outputCollection in a following script task?
    on the db the process outputCollection looks like this:
    Code:
        "outputCollection": [
            {
                "processId": "656f6aec02143b973",
                "resolution": "Reviewed",
                "resolutionNote": null,
                "reviewerId": "6408b0a9550d66984",
                "reviewerName": "Reviewer 1"
            },
            {
                "processId": "656f6aec02143b973",
                "resolution": "Changes",
                "resolutionNote": "Here is my note as review2",
                "reviewerId": "6408b0f882f2664f2",
                "reviewerName": "Reviewer 2"
            },
            {
                "processId": "656f6aec02143b973",
                "resolution": "Changes",
                "resolutionNote": "my note as reviewer-3",
                "reviewerId": "6408b1303dd2d9f48",
                "reviewerName": "Reviewer 3"
            }
        ]​
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Maybe you need to access it from the parent process, as accessing from the multi-instance sub-process does not make sense.

    You should be able to access it as a variable, in your case it is $outputCollection. Then you can write some logic that will compose a string from it to be used in a text.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • hi-ko
      Member
      • May 2015
      • 90

      #3
      sorry - my bad. I tried to retrieve access from the parent process by running something like
      Code:
      bpm\createdEntity\attribute($reviewSubProcessAliasId, 'ReviewResultCollection')
      but actually the outcome is already stored in the parents variable configured in the subprocess details ...

      thanks for nudging me in the right direction

      Comment

      Working...