Question

Blank Documents retrieved after decoding using Java Code/Base64Decode function

Hi Team,

We are receiving the document from external system in Base64 format. I am trying to use Java code to decode base64 to binary and then AttachToWork activity to attach the document to work Object, Documents are getting attached without content. PFB for the Java code:

String s = tools.getParamValue("Markup").toString(); //markup is the base64 encoded string

byte[] byteArray = new com.pega.pegarules.pub.util.Base64Util().decodeToByteArray(s);

tools.putParamValue("PDFDocument",byteArray);

Also I have tried base64Decode, but still documents without content are being attached to WorkObject. Do I need to use pyAttachmentContent property? as of now I am storing the base64Stream from external system in property of type Text.

Requirement is : External system sends the base64 stream, We need to share the document to user after decoding using Connect-SOAP.

Please note: There is no issue at external system. they are sending extpected base64 stream.

Comments

Keep up to date on this post and subscribe to comments

September 1, 2019 - 3:17pm
Response to KevinZheng_GCS

Yes its similar to the Code I mentioned above. After the code in Java step I am calling AttachToWork activity.

Attaching SS.