Getting Started with Camunda & Spring Boot ๐Ÿƒ

This tutorial intends to gives you a quick and practical introduction to the open-source workflow and decision automation platform Camunda! ๐ŸฆŠ

Here you can find the code for this chapter under the git tag chapter-1.

The easiest way to get started is t…


This content originally appeared on DEV Community and was authored by Thomas Gotwig

This tutorial intends to gives you a quick and practical introduction to the open-source workflow and decision automation platform Camunda! ๐ŸฆŠ

Here you can find the code for this chapter under the git tag chapter-1.

The easiest way to get started is to download this sample project:

curl -L https://github.com/camunda/camunda-get-started-spring-boot/archive/Step-3.zip \
  | bsdtar -xvf - -C .

Which you can then execute with Maven:

cd camunda-get-started-spring-boot-Step-3 && mvn spring-boot:run

Now surf towards localhost:8080 and login via demo & demo:

image

๐ŸŒ Taking a closer look into the browser app

Now click on Tasklist:

image

From the second column you can see that you have a process running, which is on hold because of the User Task named Check the request, which requires that a user takes a look at it and allows further execution:

image

You can do so by clicking on Complete from within the first tab:

image

โš™๏ธ Adding a Service Task to loanApproval.bpmn

One way to let Camunda execute a own Java function by creating a Service Task from within the Camunda Modeler (you can install it on Linux by executing support/xdg_register.sh after extracting the archive), you should see the following view by opening loanApproval.bpmn with the modeler:

image

Within block #1 you can set ID and Name, block #2 is for pointing to your own Java function. It's most practical name ID like your Java function:

package org.camunda.bpm.getstarted.loanapproval.delegates;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;

@Component
public class MainDelegate {

    public void validateTheRequest(DelegateExecution execution) {
        System.out.println("๐Ÿš€ Executing MainDelegate.validateTheRequest");
    }
}

Now you should see a new item from within your browser:

image

Switch back to the first tab Form and click again on Complete, this time it should go through your own Java function, the Spring terminal proves it:

...
2021-11-26 20:19:49.855  INFO 2249 --- [nio-8080-exec-5] o.s.web.servlet.DispatcherServlet        : Completed initialization in 5 ms
๐Ÿš€ Executing MainDelegate.validateTheRequest

Nice! ๐Ÿฅณ๐ŸŽ‰ I think I will add some testing for the next article, stay tuned and happy coding! ๐Ÿค—


This content originally appeared on DEV Community and was authored by Thomas Gotwig


Print Share Comment Cite Upload Translate Updates
APA

Thomas Gotwig | Sciencx (2021-11-27T08:39:38+00:00) Getting Started with Camunda & Spring Boot ๐Ÿƒ. Retrieved from https://www.scien.cx/2021/11/27/getting-started-with-camunda-spring-boot-%f0%9f%8d%83/

MLA
" » Getting Started with Camunda & Spring Boot ๐Ÿƒ." Thomas Gotwig | Sciencx - Saturday November 27, 2021, https://www.scien.cx/2021/11/27/getting-started-with-camunda-spring-boot-%f0%9f%8d%83/
HARVARD
Thomas Gotwig | Sciencx Saturday November 27, 2021 » Getting Started with Camunda & Spring Boot ๐Ÿƒ., viewed ,<https://www.scien.cx/2021/11/27/getting-started-with-camunda-spring-boot-%f0%9f%8d%83/>
VANCOUVER
Thomas Gotwig | Sciencx - » Getting Started with Camunda & Spring Boot ๐Ÿƒ. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/27/getting-started-with-camunda-spring-boot-%f0%9f%8d%83/
CHICAGO
" » Getting Started with Camunda & Spring Boot ๐Ÿƒ." Thomas Gotwig | Sciencx - Accessed . https://www.scien.cx/2021/11/27/getting-started-with-camunda-spring-boot-%f0%9f%8d%83/
IEEE
" » Getting Started with Camunda & Spring Boot ๐Ÿƒ." Thomas Gotwig | Sciencx [Online]. Available: https://www.scien.cx/2021/11/27/getting-started-with-camunda-spring-boot-%f0%9f%8d%83/. [Accessed: ]
rf:citation
» Getting Started with Camunda & Spring Boot ๐Ÿƒ | Thomas Gotwig | Sciencx | https://www.scien.cx/2021/11/27/getting-started-with-camunda-spring-boot-%f0%9f%8d%83/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.