Importing self-packaged .zip applications

Hi,

I am using flowable 6.5 with tomcat and mysql. I have used the Flowable Modeler to create an application, which I then exported as a .zip file.
My aim was to edit the json form-definitions manually, repack the .zip file using 7zip and then import the modified application again. That, however, does not work; TomCat spits out a stacktrace complaining about a malformed .zip file:

2020-08-20 14:03:59.467 ERROR 12876 — [nio-8080-exec-3] o.f.u.m.s.AppDefinitionImportService : Error reading app definition zip file

java.lang.IllegalArgumentException: MALFORMED
at java.util.zip.ZipCoder.toString(ZipCoder.java:58) ~[?:1.8.0_162]
at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:300) ~[?:1.8.0_162]
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:122) ~[?:1.8.0_162]
at org.flowable.ui.modeler.service.AppDefinitionImportService.readZipFile(AppDefinitionImportService.java:254) ~[flowable-ui-modeler-logic-6.5.0.jar:6.5.0]
at org.flowable.ui.modeler.service.AppDefinitionImportService.importAppDefinition(AppDefinitionImportService.java:158) ~[flowable-ui-modeler-logic-6.5.0.jar:6.5.0]
at org.flowable.ui.modeler.service.AppDefinitionImportService.importAppDefinitionNewVersion(AppDefinitionImportService.java:140) ~[flowable-ui-modeler-logic-6.5.0.jar:6.5.0]
at org.flowable.ui.modeler.service.AppDefinitionImportService$$FastClassBySpringCGLIB$$79794dab.invoke() ~[flowable-ui-modeler-logic-6.5.0.jar:6.5.0]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366) ~[spring-tx-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) ~[spring-tx-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.flowable.ui.modeler.service.AppDefinitionImportService$$EnhancerBySpringCGLIB$$4a8ea6ae.importAppDefinitionNewVersion() ~[flowable-ui-modeler-logic-6.5.0.jar:6.5.0]
at org.flowable.ui.modeler.rest.app.AppDefinitionResource.importAppDefinition(AppDefinitionResource.java:113) ~[flowable-ui-modeler-rest-6.5.0.jar:6.5.0]
at org.flowable.ui.modeler.rest.app.AppDefinitionResource$$FastClassBySpringCGLIB$$46b04911.invoke() ~[flowable-ui-modeler-rest-6.5.0.jar:6.5.0]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366) [spring-tx-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) [spring-tx-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) [spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) [spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) [spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.flowable.ui.modeler.rest.app.AppDefinitionResource$$EnhancerBySpringCGLIB$$f2e0e8a0.importAppDefinition() [flowable-ui-modeler-rest-6.5.0.jar:6.5.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162]
… and so on.

I was thinking maybe I messed up the json or it’s encoding while editing; but the same error persists if I don’t edit the files at all. Just unpacking and repacking the .zip file is enough to make the import impossible.

Is that intended behavior, i.e are these .zip files meant to be immutable?


Concerning why I’m even trying to edit the form-definitions manually; I wanted to test the pdfViewer field, as documented here: https://forms.flowable.io/docs/component-pdfviewer.html
That field (and some others) are not documented in https://flowable.com/open-source/docs/bpmn/ch08-Forms/ and are not available in the modeler application;

Am I trying to do something fully impossible?

Thanks in advance

No, but when zipping you need be very careful. Typical programs add a folder (or remove it). Check the structure of the original zip file and make sure it’s exactly the same after rezipping.

Note that you’re referencing an enterprise feature there. Please ask such questions on the enterprise forum: https://forum.flowable.com/

I am running into the same issue. Export a flowable app using flowable design, unpack, don’t modify, re-zip it, verify that the structure of the rezipped archive is the same (folder structure) and tried to import. Fails consistently:

java.lang.NullPointerException: null
        at com.flowable.design.service.editor.AppDefinitionImportService.importAppDefinition(AppDefinitionImportService.java:208) ~[flowable-ui-design-logic-3.8.16.jar:na]