camunda-community-hub / camunda-platform-7-camel

Community Extension to add Apache Camel support for Camunda Platform 7
Apache License 2.0
82 stars 57 forks source link

Pass variable to camel route #41

Open vagostep opened 6 years ago

vagostep commented 6 years ago

Hi, i follow the instructor for the readme page with indicate that the form for pass variable to a camel route.

The code is: "${camel.sendTo('direct:llamarPrueba', 'request')}"

Here, i call the route "llamarPrueba" and send the variable request.

The camel route is this: from("direct:llamarPrueba") .routeId(ROUTE_NAME) .marshal(marshaller) .to("spring-ws:http://localhost:8081/ws") .unmarshal(marshaller);

But when the marshal tried to process the variable, throw:

java.io.IOException: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: java.util.HashMap to the required type: java.io.InputStream with value {request=com.example.demo.cliente.GetCountryRequest@1922e2c1}

How i get only the value of 'request' for make the soap request properly?

seletz commented 6 years ago

I think you can only marshal simple java types that way. That is, the process variable in this case sholuld be a simple java type (string, integer).

If you need complex types you might want to serialize them to e.g. JSON/XML and use spin in camuda to process/filter them.