I have a string json in my camunda variable like this [{“roleCode”:“OWNE”,“roleName”:“Người vay”,“perName”:“AAA”,“nationalityCode”:“VIETNAM”,“nationalityName”:“AAA”,“startDate”:null,“endDate”:null,“identityType”:null,“content”:null}]
then in my bpmn model in node service task I use groovy script inline to get it
def json = execution.getVariable(“GeneralCriteriaCountryNationJson”)
then I convert it to json using spin put to camunda variable as type json
def v = Spin.JSON(json)
then I override GeneralCriteriaCountryNationJson variable with execution.setVariable(“GeneralCriteriaCountryNationJson”, v)
when I check in camunda GeneralCriteriaCountryNationJson still type string not json but when I change execution.setVariable(“GeneralCriteriaCountryNationJson2”, v) new variable will set as json type. Is any way to fix this problem thanks.
If you were using JavaScript in your script, I believe this behavior would be different, and the type of the variable would also be overwritten when overwriting the variable… I’m not sure, but you can do some tests, because as far as I remember, I’ve had problems similar to yours.