Using geojson


#1

Hi all,

Currently i have a model that is storing formfield data as string but i ran in the issue of the 4000 chars constraint so i would like to alter my model to store the data as json instead of a string. I’ve done some reading and found that i can use org.camunda.spin.Spin.JSON in my java code to parse my object to json and also the other way around. The issue i’m having now is that i have no clue how i can model this. I see that that i can assign “custom type” for my field by what should the actual type then be?


#2

type should be Json

Refer this docs for writing JSON object using SPIN:

https://docs.camunda.org/manual/7.7/reference/spin/json/02-writing-json/

Examples using spin:


#3

I thought so to but if I try to set my type to Json like this:

<camunda:formData>
<camunda:formField id=“feature” label=“The feature to validate” type=“Json” />
</camunda:formData>

i get
Could not parse BPMN process. Errors:

  • unknown type ‘Json’

#4

Value should be serialized as Stringified Json String


#5

Hi aravindhrs,

I followed the docs and used Spin.Json to serialise my jsonstring and have the following code:

 Map<String, Object> parameters = new HashMap<>();
 SpinJsonNode json = Spin.JSON(jsonObjectAsString);
 parameters.put(processDefinition().getFeatureKey(), json);

 String processInstanceName = processDefinition().getProcessDefinitionKey();
 ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processInstanceName, parameters);
 return processInstance.getProcessInstanceId();

did I make any mistake here?


#6

Hi guys,

I think Json is not supported as a variable type for form fields. You could use embedded forms instead of generated forms to submit this kind of variable.

Cheers,
Thorben