Flowable Junit - Passing collibra custom form type variables

Hi All,

We are trying to run Junit (v.4) generated by Flowable 5.22 plug-in (in Eclipse oxygen) for an Out-of-the-box workflow - IntakeDataAsset.bpmn.


My test class is as follows:

package org.flowable.designer.test;

import static org.junit.Assert.assertNotNull;

import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Map;

import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.test.ActivitiRule;
import org.junit.Rule;
import org.junit.Test;

public class ProcessTestIntakeDataAsset {

private String filename = "C:\\Dev\\eclipse-4.7.1a\\workspaces\\FirstProject\\MyFirstProject\\src\\main\\resources\\diagrams\\IntakeDataAsset.bpmn";

@Rule
public ActivitiRule activitiRule = new ActivitiRule();

@Test
public void startProcess() throws Exception {
	RepositoryService repositoryService = activitiRule.getRepositoryService();
	repositoryService.createDeployment().addInputStream("intakeDataAsset.bpmn20.xml",
			new FileInputStream(filename)).deploy();
	RuntimeService runtimeService = activitiRule.getRuntimeService();
	Map<String, Object> variableMap = new HashMap<String, Object>();

	variableMap.put("signifier", "Asset123");
	variableMap.put("vocabulary", "00000000-0000-0000-0000-000000006015");
	variableMap.put("conceptType", "00000000-0000-0000-0000-000000031004");
	ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("intakeDataAsset", variableMap);
	assertNotNull(processInstance.getId());
	System.out.println("id " + processInstance.getId() + " "
			+ processInstance.getProcessDefinitionId());
}

}

Running the test class gives following exception:

org.activiti.engine.ActivitiIllegalArgumentException: unknown type ‘assetType’ conceptType
at org.activiti.engine.impl.form.FormTypes.parseFormPropertyType(FormTypes.java:55)
at org.activiti.engine.impl.form.DefaultFormHandler.parseConfiguration(DefaultFormHandler.java:61)
at org.activiti.engine.impl.form.DefaultStartFormHandler.parseConfiguration(DefaultStartFormHandler.java:34)
at org.activiti.engine.impl.bpmn.parser.handler.StartEventParseHandler.createStartFormHandlers(StartEventParseHandler.java:86)
at org.activiti.engine.impl.bpmn.parser.handler.StartEventParseHandler.executeParse(StartEventParseHandler.java:58)
at org.activiti.engine.impl.bpmn.parser.handler.StartEventParseHandler.executeParse(StartEventParseHandler.java:38)
at org.activiti.engine.impl.bpmn.parser.handler.AbstractBpmnParseHandler.parse(AbstractBpmnParseHandler.java:81)
at org.activiti.engine.impl.bpmn.parser.handler.AbstractFlowNodeBpmnParseHandler.parse(AbstractFlowNodeBpmnParseHandler.java:27)
at org.activiti.engine.impl.bpmn.parser.handler.AbstractActivityBpmnParseHandler.parse(AbstractActivityBpmnParseHandler.java:36)


The issue is that java is not able to identify Collibra custom form type - assetType (for variable - conceptType) .

Can anyone please help us fixing the issue?

Thanks.

Have you tried running this on Flowable? If so, which version?

In case you have custom form types, you need to register its variable type with the engine configuration through for example processEngineConfiguration#setCustomPostVariableTypes(). Can you give some more info what the ‘assetType’ is?

Hi Joram,

Thank you for the reply.
We are using Flowable Eclipse BPMN 2.0 Designer plugin of version 5.22.0

We took a Out-Of-The-Box workflow named “Propose New Data Asset”, and trying to write junit test for this. After adding all the required jars, we are facing this issue. Here assetType is variable Type used in this workflow.
Please find attached screenshot for more clarification.
image
Thank you.