Form Engine error

Hi everyone,
I have query regarding form engine. I have to attach a form to a task in my process. I am trying to achieve this programmatically . For creating form engine i tried following two ways :
1.) FormEngine formEngine = formEngineConfiguration.getFormEngineConfiguration().buildFormEngine();
2.) FormEngine formEngine=formEngineConfiguration.buildFormEngine();

None of above give compile time error, but when i execute my code, i get an error which i am not able to understand and rectify.Tried adding liquibase-core-3.5.3.jar and liquibase-maven-plugin-3.5.3.jar . Still getting error. Could you help. Thanks in advance . Adding the error that i see :

INFO 2/11/17 1:58 PM: liquibase: Successfully acquired change log lock
INFO 2/11/17 1:58 PM: liquibase: Successfully released change log lock
Exception in thread “main” org.flowable.engine.common.api.FlowableException: Error initialising form data schema
at org.flowable.form.engine.FormEngineConfiguration.initDbSchema(FormEngineConfiguration.java:305)
at org.flowable.form.engine.FormEngineConfiguration.init(FormEngineConfiguration.java:191)
at org.flowable.form.engine.FormEngineConfiguration.buildFormEngine(FormEngineConfiguration.java:174)
at TestForm.main(TestForm.java:80)
Caused by: liquibase.exception.ChangeLogParseException: Error Reading Migration File: Found 2 files that match org/flowable/form/db/liquibase/flowable-form-db-changelog.xml
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:112)
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:17)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.Liquibase.update(Liquibase.java:188)
at liquibase.Liquibase.update(Liquibase.java:181)
at org.flowable.form.engine.FormEngineConfiguration.initDbSchema(FormEngineConfiguration.java:299)
… 3 more
Caused by: java.io.IOException: Found 2 files that match org/flowable/form/db/liquibase/flowable-form-db-changelog.xml
at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:205)
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:93)
… 10 more

Hi Shweta,

Attaching a form through the Flowable Form Engine, only works for forms created with the Flowable Form Modeler (or the JSON format it uses). This is not the case for you, so you should like in a different direction. Instead, you can just complete the task (through the TaskService completeTask method) with the variable values of the filled-in form.

Best regards,

Tijs

Hi Tijs,
I am afraid I am not understanding what exactly you are conveying. I’ll put my doubts clearly :

1.) When you say Flowable Form Engine, only works for forms created with the Flowable Form Modeler (or the JSON format it uses) , does it mean forms created on flowable-modeler UI ?
If yes, then i have created a form on modeler (UI) which i have linked to a task. What I am trying to do is , fill the form programmatically by starting form engine , which is not starting.

2.) I agree I can complete the task using TaskService completeTask method . When there is no form involved , task completes successfully, but when form is involved, in order to complete the task , i need to fill the form. In order to fill the form, i need to access the form. In order to access and operate upon form, i need to start form engine , which is where i am stuck.

I hope you are getting what i am trying to do .

Thanks and regards
Shweta

Hi Tijs,
Any new change or suggestion for this ?

Hi Shweta,

I’ve tested the code I provided you with, with a BPMN XML and form definition and it works just fine. I can complete the task with the completeTaskWithForm method of the TaskService. I’ll send you this working example over email.

Best regards,

Tijs

Hi Tijs,
Thank you so much for the help :slight_smile: