Problem in getting Bean Object in JavaDelegate

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2012 10:36 AM
We are using restful api to access Activiti Process as webservices.
We are sending parameters (including objects) to workflow serviceTask.
But when we try to retrieve the object in JavaDelegate using "execution.getVariable("objectName")" ,its return String object byDefault which cannot be cast to specific bean object which it belongs.
the exception —–>
here how I send parameters to the workflow——–>
here how I get variable in JavaDelegate——>
We are sending parameters (including objects) to workflow serviceTask.
But when we try to retrieve the object in JavaDelegate using "execution.getVariable("objectName")" ,its return String object byDefault which cannot be cast to specific bean object which it belongs.
the exception —–>
java.lang.ClassCastException: java.lang.String cannot be cast to net.simplyfiIT.dto.UserBean
here how I send parameters to the workflow——–>
param.put("processDefinitionId", processDefinitionId); param.put("beanObject",user); param.put("screenName", screenName); param.put("action","Initiate Create User"); param.put("object", object); //Call activiti api processInstanceId=HandleActivitiProcess.startRequestedProcess(param);
here how I get variable in JavaDelegate——>
Object obj = execution.getVariable("beanObject"); //this is the object String scName = (String) execution.getVariable("screenName");
Labels:
- Labels:
-
Archive
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2012 10:37 AM
how can I get the Original object in JavaDelegate???
Please help
Please help

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2012 11:08 AM
Hi,
execution.getVariable("object") call is right.
But the issue is that you can't sent Java objects to the REST API. It only accepts primitives, String and Dates.
Best regards,
execution.getVariable("object") call is right.
But the issue is that you can't sent Java objects to the REST API. It only accepts primitives, String and Dates.
Best regards,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2012 12:42 PM
what about sending List or Array in REST API

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2012 03:01 AM
Hi,
You mean a list of Strings for example? That's not implemented right now, but that's easy to add.
Let me know if that's what you are looking for.
Best regards,
You mean a list of Strings for example? That's not implemented right now, but that's easy to add.
Let me know if that's what you are looking for.
Best regards,

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2012 03:14 AM
hi ,
thanks for your reply.
Yes right now I am looking for sending list or array to the workflow..
thanks for your reply.
Yes right now I am looking for sending list or array to the workflow..
