Activiti REST API and
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2015 05:47 AM
Dear all,
I have one program client which use Activiti REST API to start process using CXF such as below:
That works well.
On the other hand, I have deployed process running on Tomcat with Activiti REST which consume Request from the client to finalize process flow.
The problem I can't do execution.getVariable("requestFromClient")
If I make toString, I can see the request from client
LOGGER.info("requestFromClient–>"
+ execution.getVariable("requestFromClient").toString());
I can see either all variables in the process by doing
My question is how to get request from client in the process. Actually, I have execution.getVariable("requestFromClient") which is null.
Thank you for your reply.
Best regards
😉
I have one program client which use Activiti REST API to start process using CXF such as below:
ProcessInstanceCreateRequest reqProcess = new ProcessInstanceCreateRequest(); reqProcess.setProcessDefinitionKey("processRequest"); variable.setName("requestFromClient"); variable.setValue(requestObject); reqProcess.setVariables(variables); int resp = WebClient.fromClient(rsWebClient) .header("Authorization", setUser()).accept("application/json") .type("application/json").path("/service").path("/runtime") .path("/process-instances").post(reqProcess).getStatus(); return resp;
That works well.
On the other hand, I have deployed process running on Tomcat with Activiti REST which consume Request from the client to finalize process flow.
The problem I can't do execution.getVariable("requestFromClient")
If I make toString, I can see the request from client
LOGGER.info("requestFromClient–>"
+ execution.getVariable("requestFromClient").toString());
I can see either all variables in the process by doing
for (String string : varNames) { LOGGER.info("Variable Named " + string + " exists"); }
My question is how to get request from client in the process. Actually, I have execution.getVariable("requestFromClient") which is null.
Thank you for your reply.
Best regards
😉
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2015 10:50 AM
I don't understand what you are doing exactly. Can you include the full source code of the part where you want to execute the execution.getVariable method?
Best regards,
Best regards,
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2015 11:37 AM
Now I solved that issue by using ObjectMapper as below
<java>
ObjectMapper mapper = new ObjectMapper();
JSONObject objectJson = new
JSONObject(execution.getVariable("requestFromClient").toString());
String obj=String.valueOf(objectJson);
LOGGER.info("object –>" +objectJson );
Request reqFromClient = mapper.readValue(obj, Request.class);
</java>
<java>
ObjectMapper mapper = new ObjectMapper();
JSONObject objectJson = new
JSONObject(execution.getVariable("requestFromClient").toString());
String obj=String.valueOf(objectJson);
LOGGER.info("object –>" +objectJson );
Request reqFromClient = mapper.readValue(obj, Request.class);
</java>
