Read Forms from BAR file - Flowable in code -


#1

I need an example of usign FormEngine. To be more especific… im executing this -see code - but there’s no forms found in my BAR file :frowning: The BAR file was exported from Flowable Modeler and it contains one form and one process and app. Maybe there’s other way to deploy and obtain forms…?

RepositoryService repositoryService = processEngine.getRepositoryService();
FormRepositoryService formRepositoryService =  formEngine.getFormRepositoryService();
File file = new File(path);

ZipInputStream inputStream = new ZipInputStream(new FileInputStream(path));
String idDeployParent = repositoryService.createDeployment()
        .name(file.getName())
        .addZipInputStream(inputStream)
        .deploy().getId();


DeploymentEntity deploymentEntity = (DeploymentEntity) repositoryService.createDeploymentQuery().list().get(0);

formRepositoryService.createDeployment()
        .name(file.getName())
        .parentDeploymentId(idDeployParent)
        .deploy();

System.out.println(" FORMS FOUND: " + formRepositoryService.createFormDefinitionQuery().list().size());