We use ProcessFlow for approval of requisitions. Based on value, ReqLoc, and other factors. If the requisition is unreleased or rejected back to the requester, the approver adds a comment for the requester just prior to taking the unrelease/reject action as to why the action was taken.
The Flow then sends an email to the requestor, with some basic information from the requisition, such as total requisition value, description, and requisition number as long with the message (comment).
As there may be more than one message attached to a workunit from different approvers along the way. The system is attaching the first message to the workunit, not the last message which is intended for the requester.
When looking at the AssgnNode, we can see that it is pull all comments:
CommentIn = <_messages> Procurement being ran. DLS Mini Bid awarded to Henderson All Contracts have been executed.Evaluating JavaScript expression if (CommentIn != '') { var b1 = CommentIn.indexOf(">") var b2 = CommentIn.indexOf(">",parseInt(b1+1)) var e1 = CommentIn.indexOf("<") var e2 = CommentIn.indexOf("<",parseInt(e1+1)) var e3 = CommentIn.indexOf("<",parseInt(e2+1)) CommentOut = CommentIn.substring(parseInt(b2+1),parseInt(e3)) };; to value Procurement being ran. DLSVariables: CommentIn(Type=String) = <_messages> Procurement being ran. DLS Mini Bid awarded to Henderson All Contracts have been executed.Activity completed
But when looking at the EmailNode, only the first comment is desplayed in the email:
Email Email6100: Executing Email activity nodeEmail Email6100: Email properties before variable substitution and expansion: To: Cc: Bcc: From: processflow@rgrta.com Subject: Requisition has been rejected.Email Email6100: Email content before variable substitution:Your requisition has been rejected.Requisition Number: Requisition Description: Requester: Request Amount: Comments: Email Email6100: Email properties after variable substitution and expansion: To: XXX@XXX.com Cc: Bcc: From: processflow@XXX.com Subject: Requisition 0004740 has been rejected.Email Email6100: Email content after variable substitution:Your requisition has been rejected.Requisition Number: 0004740Requisition Description: FY16 Pension & OPEB Benefit PlRequester: XXX XXXRequest Amount: $XX,000.00Comments: Procurement being ran. DLSActivity completedEmail6100_errorCode = 0Email6100_informationCode = 0Email6100_returnMessage = CompletedEmail6100_outputData =
The message in the email should have read "Comments: All Contracts have been executed."
Any help you can provide will be greatly appropriated.
Thank you!
_dataArea="" & _module="pfi" & _objectName="PfiMessage" & _actionName="Find" & _actionOperator="NONE" & _actionType="MultipleRecordQuery" & _runAsUser="" & _pageSize="30" & _relationName="" & _setName="SymbolicKey" & _asOfDate="" & _effectiveDate="" & PfiWorkunit="" & Message & Subject
I am sure that there are many ways to achieve the same end result. However, we are newer to this process and are trying to work with what was originally designed.
With that being said,what we think is happening is that the below parsing function is formatting and returning only the first comment in the string array "_messages" and we need it to return the last comment. Can someone help us with this?
if (CommentIn != '') { var b1 = CommentIn.indexOf(">") var b2 = CommentIn.indexOf(">",parseInt(b1+1)) var e1 = CommentIn.indexOf("<") var e2 = CommentIn.indexOf("<",parseInt(e1+1)) var e3 = CommentIn.indexOf("<",parseInt(e2+1)) CommentOut = CommentIn.substring(parseInt(b2+1),parseInt(e3)) }