Hi,
I am trying to call a smart service where parameter type is a CDT object, although I have create a process variable of that CDT type I am still getting cast exception.
Smart Service
a!startProcess( processModel: cons!Notes, processParameters: { RWM_Notes: 'type!{urn:com:appian:types:ABC}Notes'( date:now(), createdBy: loggedInUser(), notesMessageBody: local!notesContent ) }, onSuccess: a!save(local!tempStatus,"Notes Added Successfully!"), onError: a!save(local!tempStatus,"Something is wrong!") )
Error
Expression evaluation error [evaluation ID = 5P1YOOU9] in rule 'summary' at function a!startProcess [line 380]: Could not cast from RecordType to Process Model. Details: CastInvalid
Discussion posts and replies are publicly visible
Assuming that the error is with local!notesContent, you need to do an explicit type cast to the CDT type using the function cast().
Stefan Helzle
Can you provide SAIL snippet on what you are suggesting, please.
docs.appian.com/.../Casting.html
RWM_Notes: 'type!{urn:com:appian:types:ABC}Notes'( date:now(), createdBy: loggedInUser(), notesMessageBody: cast(type!YOUR_CDT_HERE, local!notesContent) )
Unfortunately, it did no worked. Still the same error.
OK. You need to find out to which line the error relates. Which object does cons!Notes refer? This must be a process model.