I am trying to implement the automation to sync notes from Agile Desktop interaction to System of record, following the guidelines in "Agile Desktop Implementation Guide". However, I am facing type casting issues with the automation. The guidelines specify the SaveNotes activity with Notes parameter of "String" type, and that the Notes parameter is a JSON string containing an array of notes. However, when the automation is invoked, the system throws exception that it is not able to cast.
"Object of type 'System.Collections.Generic.List`1[OpenSpan.Interactions.Note]' cannot be converted to type 'System.String'."
How should this be handled? Is there a way to convert the data type in automation, or shall there be a different type specified in Interaction.xml, in order to handle this?
I was trying with the information mentioned in the Pega Robotic Automation Agile Desktop Implementation Guide, under "Notes Activities" section. However, I was using the older Pega robotics Studio version 8.0.1016.0, where I observed the exception mentioned above. The automation was consuming SaveNotes ActivityStarted event (see SaveNotes.jpg attached).
Thank you for the update. Using the events provided on the NoteController component is the way to go. I think the original document you used has some dated material in it, I'll get with the documentation group and get it updated.
There are two events of interest for saving notes; OnSaveNotes and OnSaveNote. As their names imply, one gives you an array of Note objects and the other fires for each note. The ErrorSaving boolean is used to indicate if an error occurred saving the note to the SOR.