Redeploying an existing process

Hi,

When deploying a process via the java api it works fine the first deployment, but if I make a change to the diagram and redeploy then the forms can no longer be found.

I am doing the following to deploy the process and form

repositoryService.createDeployment()
.name(“TestSim”)
.source(“TestSim”)
.addClasspathResource(“bpmn/test.bpmn”)
.addClasspathResource(“forms/test-form.html”)
.enableDuplicateFiltering(true)
.deploy();

The form is define like this in the user task

embedded:deployment:forms/test-form.html

And this is the error I get

[qtp779639592-36] WARN ExceptionHandler - org.camunda.bpm.engine.rest.exception.InvalidRequestException: The form with the resource name ‘forms/test-form.html’ cannot be found in deployment.

Cheers

Your formkey is looking in the deployment.
Change deployment to app

See the description: https://docs.camunda.org/manual/7.7/user-guide/task-forms/#embedded-task-forms of embedded and app usage.

Unfortuantely I have already tried that and it gives me a different error of
Form failure: The context path is either empty or not defined.

as per the docs
deployment:: The file is part of your deployment (e.g., by adding it to your process archive), which means that it is stored in the Camunda database. It can then be loaded from there. Note that this allows versioning of your form alongside the process model.

So the form is fine on the initial deployment, but after that it is not able to be found using embedded:deployment

Can you clarify how you are deploying the first time? This is on default spring deployment?

feels very similar to this issue: Form uploaded via REST api is not getting loaded in tasklist

This is in a spring boot application and this bpmn file and form are deployed as follows when the app starts up

@Component
public class TestApplicationStartup implements ApplicationListener {

private RepositoryService repositoryService;

public TestApplicationStartup(RepositoryService repositoryService) {
this.repositoryService = repositoryService;
}

@Override
public void onApplicationEvent(final ApplicationReadyEvent event) {
repositoryService.createDeployment()
.name(“TestSim”)
.source(“TestSim”)
.addClasspathResource(“bpmn/test.bpmn”)
.addClasspathResource(“forms/test-form.html”)
.enableDuplicateFiltering(true)
.deploy();
}
}

See the link i posted above. Looks to be your exact issue