I have a Json String that I want to add in an Input Parameter.
It works when I deploy it on a Standalone Camunda (Docker).
However the same does not work in my Spring Boot App.
I get the following exception:
org.camunda.bpm.engine.ScriptEvaluationException: Unable to evaluate script: org.camunda.spin.spi.SpinDataFormatException: SPIN-01004 No matching data format detected
at org.camunda.bpm.engine.impl.scripting.CompiledExecutableScript.evaluate(CompiledExecutableScript.java:61)
.....
org.camunda.spin.impl.logging.SpinCoreLogger.unrecognizableDataFormatException(SpinCoreLogger.java:57)
at org.camunda.spin.impl.SpinFactoryImpl.createSpinFromReader(SpinFactoryImpl.java:131)
at org.camunda.spin.impl.SpinFactoryImpl.createSpin(SpinFactoryImpl.java:54)
at org.camunda.spin.impl.SpinFactoryImpl.createSpinFromString(SpinFactoryImpl.java:107)
at org.camunda.spin.impl.SpinFactoryImpl.createSpin(SpinFactoryImpl.java:51)
at org.camunda.spin.Spin.S(Spin.java:68)
at org.camunda.spin.Spin$S.callStatic(Unknown Source)
I have my dependencies:
- camunda-bpm-spring-boot-starter-webapp
- camunda-engine-plugin-spin
- groovy-all
Here is my Groovy Script
import static org.camunda.spin.Spin.*
import groovy.json.*
def asJson(String jsonStr) {
jsonSlurper = new JsonSlurper()
json = jsonSlurper.parseText(jsonStr)
S(JsonOutput.toJson(json))
}
def str = """{
"host" : {
"url" : "https://swapi.dev/api",
"auth" : {
"NoAuth" : {
}
}
},
"method" : {
"Get" : {
}
},
"path" : {
"Path" : {
"elems" : [
"people",
"1"
]
}
},
"queryParams" : {
"NoParams" : {
}
},
"headers" : {
"NoHeaders" : {
}
},
"body" : {
"NoBody" : {
}
},
"responseRead" : {
"StringRead" : {
}
},
"handledErrors" : [
]
}"""
asJson(str)