Hey,
after experimenting with the External Task Engine for a while I noticed that
org.camunda.spin:camunda-spin-core
and org.camunda.spin:camunda-spin-dataformat-all
, both with provided jars with version 7.12.0, behave not as documented when used with external tasks that add process variables on completion.
Case Study 1:
The following object combinedXML should be persisted after completing my external task. CombinedXML was created with SpinValues.xmlValue(XML(reader)).create()
where reader
is a reader to the provided XML file. Note that neither public static XmlValueBuilder xmlValue(org.camunda.spin.xml.SpinXmlElement value)
nor create()
are documented, I just went along with your tutorial here XML | docs.camunda.org. The object is then added to a hashmap that is used in the completion call org.camunda.bpm.client.task.ExternalTaskService void complete(ExternalTask externalTask, Map <String ,Object > variables)
.
This results in the following exception:
Caused by: org.camunda.bpm.client.exception.ValueMapperException: TASK/CLIENT-01023 Cannot find serializer for value 'Value '<?xml version="1.0" encoding="UTF-8"?><rdf:RDF xmlns:[...]
' of type 'xml', isTransient=false'
at org.camunda.bpm.client.impl.ExternalTaskClientLogger.valueMapperExceptionDueToSerializerNotFoundForTypedValue(ExternalTaskClientLogger.java:189)
at org.camunda.bpm.client.variable.impl.DefaultValueMappers.findMapperForTypedValue(DefaultValueMappers.java:70)
at org.camunda.bpm.client.variable.impl.TypedValues.findSerializer(TypedValues.java:114)
at org.camunda.bpm.client.variable.impl.TypedValues.toTypedValueField(TypedValues.java:92)
at org.camunda.bpm.client.variable.impl.TypedValues.serializeVariables(TypedValues.java:56)
... 11 more
Case Study 2:
The following XmlValue was created with your example XML snippet from XML | docs.camunda.org.
This results in
org.camunda.bpm.client.exception.ValueMapperException: TASK/CLIENT-01025 Cannot serialize variable 'combinedXML'
at org.camunda.bpm.client.impl.ExternalTaskClientLogger.cannotSerializeVariable(ExternalTaskClientLogger.java:199)
at org.camunda.bpm.client.variable.impl.TypedValues.serializeVariables(TypedValues.java:60)
at org.camunda.bpm.client.impl.EngineClient.complete(EngineClient.java:89)
at org.camunda.bpm.client.task.impl.ExternalTaskServiceImpl.complete(ExternalTaskServiceImpl.java:62)
at org.camunda.bpm.client.task.impl.ExternalTaskServiceImpl.complete(ExternalTaskServiceImpl.java:56)
at [...]
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.handleExternalTask(TopicSubscriptionManager.java:152)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.lambda$acquire$0(TopicSubscriptionManager.java:108)
at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4411)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.acquire(TopicSubscriptionManager.java:103)
at org.camunda.bpm.client.topic.impl.TopicSubscriptionManager.run(TopicSubscriptionManager.java:87)
at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: org.camunda.bpm.client.exception.ValueMapperException: TASK/CLIENT-01023 Cannot find serializer for value 'Value 'null' of type 'xml', isTransient=false'
at org.camunda.bpm.client.impl.ExternalTaskClientLogger.valueMapperExceptionDueToSerializerNotFoundForTypedValue(ExternalTaskClientLogger.java:189)
at org.camunda.bpm.client.variable.impl.DefaultValueMappers.findMapperForTypedValue(DefaultValueMappers.java:70)
at org.camunda.bpm.client.variable.impl.TypedValues.findSerializer(TypedValues.java:114)
at org.camunda.bpm.client.variable.impl.TypedValues.toTypedValueField(TypedValues.java:92)
at org.camunda.bpm.client.variable.impl.TypedValues.serializeVariables(TypedValues.java:56)
... 11 more
Which can actually be sort of explained when looking at the generated XmlValue object that is missing it’s value property when generated from a string via SpinValues.xmlValue(String myString).create()
Spin is properly integrated in my server as documented in Install the Full Distribution on a Tomcat Application Server manually | docs.camunda.org.