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 - Email Notification - Include Comment, can't find item type container

pottsm - Tuesday, January 18, 2011 2:37 PM:

I am trying to include any comments that were added previously to the Email notification on my ECNs, but am unable to find the item type with the comment field holding the information.

I am trying to set it up where if someone rejects something and had added a comment why, it goes back to someone else who can see the comment without having to go view the workflow, then sign-offs.

anyone know where the field with the comment info is?



pottsm - Sunday, February 6, 2011 11:08 AM:

so, I found the info I was looking for, but am still having some trouble getting the query to work with the email notification as the syntax for emails seems a bit different than normal AML.  I can get the info I need via regular action/report, but can't figure out how to pass the right information in the email query.

I am trying to modify the CM Activity Notification Email.

I really just have two questions:

How do I pass workflow item_number as a condition to this query?

How do I use the result of this query in the email HTML?  Is it something like: ${Item[4]/Workflow Process/Workflow Process Activity/Activity/Activity Assignment/comments}???

This is basically the query I need:

<Item type="Workflow Process" initial_action="get" action="do_l10n" select="active_date, closed_date, state, name, description, created_by_id,sub_of" >
 <name condition='eq'>${Item[2]/item_number</name>  ------ NOT SURE HOW TO PASS THIS CONDITION FROM THE EMAIL --------
  <Relationships>
    <Item type="Workflow Process Activity" action="get" select="related_id">
      <related_id>
      <Item type="Activity" action="get" select="label,name,state,active_date,subflow(name)">
        <and>
          <state condition="ne">Pending</state>
          <or>
              <is_start condition="ne">1</is_start>
              <is_auto condition="ne">1</is_auto>
          </or>
          <or>
              <is_end condition="ne">1</is_end>
              <is_auto condition="ne">1</is_auto>
          </or>
        </and>
                <Relationships>
                    <Item type="Activity Assignment" action="get" select="closed_by, closed_on, comments, path, related_id(name)" >
            <closed_by>
              <Item type="User" select="first_name,last_name" action="get">
                <Relationships>
                  <Item type="Alias" action="get" select="related_id(name)"/>
                </Relationships>
              </Item>
            </closed_by>
          </Item>  
        </Relationships>
      </Item>
      </related_id>
    </Item>
  </Relationships>
</Item>

 

I also have been able to whip up a SQL statement to get the same info, but again, just not sure how to get the info back:

select d.name, b.[name], a.[comments], e.[keyed_name]
from [activity_assignment] as a
left join [activity] as b on b.[id]=a.[source_id]
left join [workflow_process_activity] as c on c.[related_id]=b.[id]
left join [workflow_process] as d on d.[id]=c.[source_id]
left join [identity] as e on e.[id]=a.[related_id]
where  and a.[comments] is not null and a.[comments] not like ''