This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - How easily to get Workflow Map if I have Activity

vladimior - Wednesday, April 17, 2013 8:39 AM:

Hello,

I have an Activity. I need to get name of Workflow Map where this activity presented.

Now I have massive solution of this problem. It will be better to simplify because I often execute it. Using next AML I getting ItemType.

  <Item action="get" type="Workflow" select="id,related_id(id),source_type">

    <related_id>

      <Item action="get" type="Workflow Process" select="id" >

        <Relationships>

          <Item action="get" type="Workflow Process Activity" select="id,related_id(id)">

            <related_id>

              <Item action="get" type="Activity">

                <id>{Activity ID}</id>

              </Item>

            </related_id>

          </Item>

        </Relationships>

      </Item>

    </related_id>

  </Item>

Then using this ItemType I am getting all allowed workflows and their names.

<Item type="ItemType" action="get" id="{ItemType ID}">

    <Relationships>

      <Item action="get" type="Allowed Workflow" select="related_id(name)"></Item>

    </Relationships>

  </Item>

Is there exist easier way to get Workflow Maps from Activity?

Thank you.

 



vasant - Wednesday, April 17, 2013 10:16 AM:

HI,

Use below AML to get Workflow Map id from Activity Id:

<Item action="get" type="Workflow Process" select="id, copied_from, copied_from_string" >

                <Relationships>

                                <Item action="get" type="Workflow Process Activity" select="id,related_id(id)">

                                                <related_id>

                                                                <Item action="get" type="Activity">

                                                                                <id>{Activity ID}</id>

                                                                </Item>

                                                </related_id>

                                </Item>

                </Relationships>

</Item>

Here copied_from_string is id of Workflow Map.

Thanks- Vasant Padhiyar



vladimior - Thursday, May 9, 2013 10:59 AM:

Thank you, Vasant. It works fine.