Support Article

HTML Character encoding during flow action

SA-34281

Summary



During transfer assignment flow action as a local action in flows to assign the work object to other operators, if the assignment has special characters such as &, < , >, ", PEGA displays the encoded value of these characters in the Audit Note field after selecting operator.

Error Messages



Not Applicable

Steps to Reproduce

  1. Add step assignment with name as Frequency & Payment.
  2. In Assignment properties add local action "pyTransferAssignment"
  3. Run the case .
  4. Select the transfer assignment from other Actions drop down.
  5. From Transfer to dropdown select "operator" option.
  6. Select the operator.
  7. Notice the Audit note which displays &amp; instead of &


Root Cause



No Issue.

Resolution



Proposed Solution: Create a function that calls getlocalizedtext ruf and then add below logic

String aBuf = tools.getLocalizedTextForString(property,text);

if (aBuf == null) {
return null;
}

if(aBuf.indexOf("&amp;") > -1){
aBuf = aBuf.replace("&amp;" , "&");
}


if(aBuf.indexOf("&lt;") > -1){
aBuf =aBuf.replace("&lt;" , "<");
}



if(aBuf.indexOf("&gt;") > -1){
aBuf = aBuf.replace("&gt;" , ">");
}


if(aBuf.indexOf("&quot;") > -1){
aBuf =aBuf.replace("&quot;" , "\"");
}

if(aBuf.indexOf("&#61;") > -1){
aBuf = aBuf.replace("&#61;" , "=");
}

if(aBuf.indexOf("&#39;") > -1){
aBuf = aBuf.replace("&#39;" , "'");
}


if(aBuf.indexOf("&#41;") > -1){
aBuf =aBuf.replace("&#41;" , ")");
}


if(aBuf.indexOf("&#40;") > -1){
aBuf =aBuf.replace("&#40;" , "(");
}


if(aBuf.indexOf("&#59;") > -1){
aBuf.replace("&#59;" , ";");
}


return aBuf;


Published February 28, 2017 - Updated March 1, 2017

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.