Question
Masterdata
RU
Last activity: 25 Jan 2019 6:56 EST
How to add custom type in OpenSpan ? and how to access custom from pick type.
I need to add to my project custom type with my methods and properties for parsing Json file, count and assign anothe fields that aren't described in received file. I've added the dll where Idescribe my type.
Studio plugin 8.0
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Hi Andrey,
Please take a look on the following posts that cover JSON deserialization with JsonUtils component. Most probably it will cover your needs and you don't have to introduce custom type.
https://collaborate.pega.com/discussion/ask-expert-robotics-jeff-badger-and-thomas-sasnett
https://collaborate.pega.com/question/json-util-component-usage
Masterdata
RU
Thank you!
Infosys
IN
Use this link to convert JSON object to C# file with properties and methods.
Masterdata
RU
Thank u, but I know how to create class for json on c#. I need to add this class to the pega robot solution and use it like standart classes, like EmailMessage
Infosys
IN
Just create a .net component class and add the reference in .os project and add the same in toolbox to display the component methods in the toolbox. Drag the required method into automation and extract the proxy of result then it will the properties.
Attached the doc for reference.
Masterdata
RU
Ok, but if i neet to find it in pick type? Can I do this? I've add my .dll file with data type to the references, but it doesn't appear in the pick type menu.
Infosys
IN
Try by writing JSON convert methods in dll and use those methods in the automation. This method will take json string as input and output can be class object, datatable, etc...
You can pick types from your attached screenshot but I didn't experiment for custom .dll data types.
-
Michael Feldhusen