Giter Club home page Giter Club logo

Comments (8)

jangalinski avatar jangalinski commented on June 30, 2024 1

I would suggest to raise a support ticket

from camunda-bpm-spring-boot-starter.

osteinhauer avatar osteinhauer commented on June 30, 2024

Hi.

IMHO: never tried that. Could you please provide an example project (on github)?

Am 07.02.2016 um 10:47 schrieb Kiyan Ahmadizadeh [email protected]:

Hello,

I've been working on an application using the webapp starter, and have been trying to get an embedded form to work. My project structure is very similar to the one found in examples/camunda-spring-boot-starter-example-webapp. I tried creating a folder src/main/webapp/forms with a file greetingForm.html , and modifying sample.bpmn so that the user task "do something" has form key app:embedded:forms/greetingForm.html, but I get a CORS error displayed when trying to view the form in the Tasklist.

We experienced a similar problem with a non-spring-boot Camunda project, and the issue went away when we used an META-INF/process.xml without any configuration, like:



default




but the same approach doesn't seem to work here. The problem seems to involve the contextPath being null in the response below, which is obtained by tasklist app when using the API endpoint /api/engine/engine/default/task/1408

{"key":"embedded:app:forms/greetingForm.html","contextPath":null}
Can embedded forms work with the spring boot webapp starter? Is this a bug, pending feature, or something I'm missing? Thanks!


Reply to this email directly or view it on GitHub.

from camunda-bpm-spring-boot-starter.

lockoff avatar lockoff commented on June 30, 2024

Sure! Please checkout my fork of the repo, branch embedded-forms off tag 1.1.0 (the version we're using, but this same problem exists on master).

examples/camunda-spring-boot-starter-example-webapp has been modified so that sample.bpmn uses an embedded form in the "do something" task. The form is located at src/main/webapp/greetingForm.html. If you start the example with mvn spring-boot:run, make your way to the tasklist, start the Sample process, and click on the task that's assigned to you when the process starts (I use the notification about the task being assigned to me that pops up in the bottom right) you encounter the error.

Thanks for the help!

from camunda-bpm-spring-boot-starter.

lockoff avatar lockoff commented on June 30, 2024

If it helps, I'm working off of this example from the Camunda docs.

from camunda-bpm-spring-boot-starter.

lockoff avatar lockoff commented on June 30, 2024

We have a workaround, but I tracked down more of an exact cause using my debugger and wanted to share. Because there is no process engine application (sometimes called a process archive) associated with the SpringAutoDeployment, the context path for the application cannot be retrieved, and this results in the embedded form key not being translated.

More precisely, the relevant portion of the call stack in Camunda 7.4 looks like:

....
ManagementServiceImpl#getProcessApplicationForDeployment(String): 86
ApplicationContextPathUtil#getApplicationPathForDeployment(ProcessEngine, String): 42
TaskResourceImpl#getForm(): 197

The TaskResourceImpl tries to set the context path in the FormDto that gets returned as the response to the task form endpoint. ApplicationContextPathUtil tries to retrieve the context path by querying the ManagementServiceImpl for the process application name. The management service returns null for the process application name, because there is no process application associated with the deployment. As a result, ApplicationContextPathUtil returns null for the context path, this is what gets set in the FormDto, and as a result the frontend cannot translate the form key into an actual URL.

If it were possible to associate a process application / process archive with the auto-created deployment, I believe that would resolve the issue.

Hope this helps. Please at-me if I can answer any questions.

from camunda-bpm-spring-boot-starter.

jangalinski avatar jangalinski commented on June 30, 2024

I think it would be a good idea to use an ProcessApplication, see

https://forum.camunda.org/t/formkey-resolve-embedded-app-fails-with-spring-boot/479
https://docs.camunda.org/manual/7.4/user-guide/process-applications/the-process-application-class/#the-embeddedprocessapplication

This might also solve #53 ... we just use processapplication.deploy instead of implementing our own resource-parser

from camunda-bpm-spring-boot-starter.

jangalinski avatar jangalinski commented on June 30, 2024

Fixed by #76

Using the SpringBootProcessApplication

@SpringBootApplication
public class MyApp extends SpringBootProcessApplication {}

fixes this issue by adding a servletContextPath="/"property to the application which is used by the formService to resolve the ":app:" identifier.

from camunda-bpm-spring-boot-starter.

mcs avatar mcs commented on June 30, 2024

Well, the same problem occurs for me when using Spring Boot 2.0.2, but setting server.servlet.contextPath doesn't fix it for me. I don't even get an error in my server log, just an invalid HTTP request to http://localhost:8080/forms/ergebnis-lesen.html?noCache=1529563649812&taskId=f5ddea46-751e-11e8-870f-aced5cb84e54&userId=demo

I am using the camunda-bpm-spring-boot-starter-webapp-ee with version 3.0.0.

from camunda-bpm-spring-boot-starter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.