Extends OOTB Camunda Entity & Tables

Hi Team,

I am using Camunda dependency in my application and exposing Rest API using OOTB services.
As per my use case, I have to persist java object as a JSON in Process Instance variable (OOTB camunda storing in bytearray in act_ge_bytearray table) so I want to extends same table and IBatics Entity.

Is it possible in Camunda ? If Yes then please provide some sample example.

Hi @sunilkaushik,

what about this feature: https://docs.camunda.org/manual/7.11/user-guide/data-formats/json/#serializing-process-variables

It’s already there without changes on the database tables.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier,

I tried this way but it’s not working for me and I am getting below error:

Cannot find serializer for value ‘ObjectValue [value=com.ihsmarkit.rc.ngp.workflow.common.kyc.model.Company@79562211, isDeserialized=true, serializationDataFormat=application/json, objectTypeName=null, serializedValue=null, isTransient=true]’.

I tried to start process instance with variables in two ways:
1-
RuntimeService runtimeService = ProcessEngines.getDefaultProcessEngine().getRuntimeService();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefKey);
Company company = new Company();
ObjectValue typedCustomerValue = Variables.objectValue(company).serializationDataFormat(“application/json”).create();
runtimeService.setVariable(processInstance.getId(), “company”, typedCustomerValue);

2-
RuntimeService runtimeService = ProcessEngines.getDefaultProcessEngine().getRuntimeService();
Map<String, Object> filteredParams = new HashMap<String, Object>();
ObjectValue typedCustomerValue = Variables.objectValue(new Company(), true)
.serializationDataFormat(“application/json”).create();
filteredParams.put(“request”, typedCustomerValue);
runtimeService.createProcessInstanceByKey(processDefKey).setVariables(filteredParams).execute();

I am using camunda-bom-7.10.0 & camunda-bpm-spring-boot-starter-webapp-3.2.0 dependencies in my project.

Apart from this, My question was to extends OOTB table and DbEntity because as per my requirement it’s needed.
I am giving one use case, at the create user time I need to persist some other user specific data as well like mobile & emp-id etc.

so please have a look into this query & issues.

Thanks,
Sunil Kaushik

Hi @sunilkaushik,

did you add the SPIN libraries to your engine: https://docs.camunda.org/manual/7.11/reference/spin/?

I would not extend the tables, you have to go deep into the internals to achive this. And you have to maintain your customization with each new version of Camunda.

Try to use your favorite persistence framework and maintain your database content either in service tasks or listeners.

Hope this helps, Ingo

Hi @Ingo_Richtsmeier,

Yes, I have spin related dependency in my project but still I am facing this error.

	<dependencies>
		<dependency>
			<groupId>org.camunda.bpm</groupId>
			<artifactId>camunda-bom</artifactId>
			<version>7.10.0</version>
			<scope>import</scope>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>org.camunda.spin</groupId>
			<artifactId>camunda-spin-bom</artifactId>
			<scope>import</scope>
			<type>pom</type>
			<version>1.2.0</version>
		</dependency>
	</dependencies>
org.camunda.spin camunda-spin-core
	<dependency>
		<groupId>org.camunda.spin</groupId>
		<artifactId>camunda-spin-dataformat-all</artifactId>
	</dependency>

Hi @Ingo_Richtsmeier,

After adding below dependency, I am able to persist java object in spin://application/json format.

                   <dependency>
		<groupId>org.camunda.bpm</groupId>
		<artifactId>camunda-engine-plugin-spin</artifactId>
		</dependency>