Cannot find form after business archive deployment

Hi.

I’ve been deploying a bar file as recommended:

    ZipInputStream inputStream = new ZipInputStream(new FileInputStream(barFileName));
    repositoryService.createDeployment()
            .name(barFileName)
            .addZipInputStream(inputStream)
            .deploy();

And it was working great. For no obvious reason forms are no longer found after deployment:

org.flowable.engine.common.api.FlowableObjectNotFoundException: Form model for task XXX cannot be found for form key YYY
at org.flowable.engine.impl.cmd.GetTaskFormModelCmd.execute(GetTaskFormModelCmd.java:98)
at org.flowable.engine.impl.cmd.GetTaskFormModelCmd.execute(GetTaskFormModelCmd.java:44)
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:51)

Any hints as to what might be wrong? The structure of the bar hasn’t changed. The form is the same.

Prior to the error I see DEBUG:

==> Preparing: select * from ACT_FO_FORM_DEFINITION where KEY_ = ? and PARENT_DEPLOYMENT_ID_ = ? and (TENANT_ID_ = ‘’ or TENANT_ID_ is null) and VERSION_ = (select max(VERSION_) from ACT_FO_FORM_DEFINITION where KEY_ = ? and PARENT_DEPLOYMENT_ID_ = ? and (TENANT_ID_ = ‘’ or TENANT_ID_ is null))
— GetFormModelWithVariablesCmd finished --------------------------------------------------------
<== Total: 0

Something’s wrong with the deployment but can’t see what.

Thanks.

I have the same problem. The Modeler saves the form internally but after creating and deploying the App as a .zip file the act_fo_form_* tables are all empty, causing the org.flowable.engine.impl.cmd.GetTaskFormModelCmd.execute(CommandContext commandContext) method to throw the org.flowable.engine.common.api.FlowableObjectNotFoundException with the message (in my case): “Form model for task sid-81F9A8BB-0053-4D2D-96C8-4A5C06697277 cannot be found for form key storeUpcEntry”.

The modeler “remembers” the form, so I presume that the act_fo_form_* tables should be populated at deployment time?

No help here?
We’re giving up on bar files and looking to use zip files instead.

Hi,

In the code where you are deploying the BAR file, is the SpringFormEngineConfigurator or the FormEngineConfigurator used there? In other words, is the Form engine active where you are deploying the BAR file? If you look in the Task app for example, you can see that the Form Engine is active because the SpringFormEngineConfigurator is used.

Best regards,

Tijs

Hi. Thanks for tips. I made some progress and decided to try deploying the bar via the flowable-rest app. The deploy is successful and I’m able to see it at the flowable-rest/service/repository/deployments/ end point.

But I’m not able to see the new deployment in flowable-task. How do I do the equivalent of ‘Publish’ from the modeler. I think I’m missing basic understanding of how this works?

Hi. Some help please? I realize it’s a n00b question, but would really appreciate a guide on how I can take a bar file and deploy it so it is available in a running flowable-task instance.

Hi,

Did you create the BAR file yourself or did you download it from the Modeler?
For a BAR file to be recognized as an app in the Flowable Task application you need an .app file in the BAR file which is a JSON file with at least a key and name property. You can download a BAR file from the Flowable Modeler to see exactly what is expected.

Best regards,

Tijs

Thanks. Yes, I have a bar file that is valid and correct (app, bpmn, forms). Should I expect that if I POST this file to the default (downloaded) flowable-rest app at flowable-rest/service/repository/deployments, it should get deployed correctly and be available for users in the flowable-task app ?

Hi,

Yes that’s the expected behaviour, it should work with the Flowable REST App because it contains all the engines. If this doesn’t work for you then please share the BAR file so we reproduce the issue.

Best regards,

Tijs

Thanks. I can’t share files outside my organization, but here is what I tried:

  1. Create a simple process model, form and app
  2. Export bar file
  3. Upload same bar to another environment

Here is what I see when sending BAR to flowable-rest:

HTTP/1.1 201 Created
{“id”:“95045”,“name”:“Test_APP_BAR2”,“deploymentTime”:“2018-04-19T23:03:21.353+08:00”,“category”:null,“url”:“http://myhost:8080/flowable-rest/service/repository/deployments/95045",“tenantId”:"”}

And in the flowable-rest logs:

Processing app resource testAppBar.app
FormDeployer: processing resource form-testFormBar2.form

But the flowable-task does not show the new process.

I have very similar behavior and I too went to ZIPs.

I basically created a simple process and app, exported the zip file, brought it in programatically using the same deploy() calls as the OP, it succeeds (doesn’t error), but then I go into the modeler and see nothing of it.

I then go to flowable-admin pages, Deployments, and I see my deployment, and in fact it shows one process definition within it (when I click Show Process Diagram, it shows correctly).

I also have all my flowable apps pointing to my one mysql db instance. Can someone verify that this functionality still works?

This should still works. Did you deploy through the app-engine’s repositoryService?

Yep, just like the OP did. Here’s my code:
processEngine = ProcessEngines.getDefaultProcessEngine();
repositoryService = processEngine.getRepositoryService();

        String barFileName = "src/main/resources/mySimpleApp.bar";
        ZipInputStream inputStream = new ZipInputStream(new FileInputStream(barFileName));
        
        repositoryService.createDeployment()
                .name("mySimpleApp.bar")
                .addZipInputStream(inputStream)
                .deploy();

After running that I can see an entry in ACT_RE_DEPLOYMENT however I don’t see the app or the processes in my Designer.

This is actually not the same issue as the OP because I can actually see the process to invoke within the Task application, just not the modeler

“repositoryService.createDeployment” is not enough, because default deployers which springProcessEngineConfiguration bootup does not containt “FormDeployer”.

You might to try following code if you were using Spring boot integration.

Blockquote
@Configuration
public class FlowableProcessConfig implements EngineConfigurationConfigurer {

....

@Override
public void configure(SpringProcessEngineConfiguration springProcessEngineConfiguration) {
    this.springProcessEngineConfiguration = springProcessEngineConfiguration;
    springProcessEngineConfiguration.setCustomPostDeployers(ImmutableList.of(new RulesDeployer(),new FormDeployer(), new DmnDeployer()));
    ...
    springProcessEngineConfiguration.setDeploymentResources(new Resource[]{resourceLoader.getResource("xxxxxx.bar")});
}

}

using “springProcessEngineConfiguration.setCustomPostDeployers” to configure your deployer. BTW, deploy “bar” file by RESR API can also work after config like this.

hope this can help you.