completeTaskWithForm: correct usage?


I am trying to complete a task via a form:

taskService.completeTaskWithForm(task.getId(), formID, null, variables);

Question: how do I get the formId of the task? I can get the formKey (task.getFormKey()), but what is the best way to get the formId?


Trying to get the FormProperties, I tried the following:

ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
FormService formService = processEngine.getFormService();

String barFileName="";
ZipInputStream inputStream = new ZipInputStream(new FileInputStream("C:\\path\to\\"));


The getFormProperties results in an empty List. can be found here: as well as the flowable.cfg.xml file.

The id to pass is the formDefinitionId, you can get this through the FormRepositoryService. Note that you’d need to have the FormEngine for this, which means you’d need to add the FormEngineConfigurator to the list of configurators of the process engine to have it be booted up together with the process engine.