Lets try to now call REST service from the camunda and dispaly the output on the prompt.
Please follow belwo given step. 1- Create bpnm file 2- upload it on Camunda server 3- star the process and you will be able to see the value from REST call on prompt.
Best of camunda is we can perform operatio using REST API call. i.e. let say you have one bpnm file and uploaded on Camunda server and you want to access the process then you can do using REST api call.
1- we will create a sevice task (external) that will send data to another service task (delegate) and we will check if the data is send properly or not using embedded camunda.
In past example https://shdhumale.wordpress.com/2023/04/24/calling-java-class-from-camunda-task-process/ we had tried to create bpmn file that will ask for user inpur when uploaded on the camunda server and when we start our springboot application it will contant this service task in bmnp file and fetch the value that is entered by the user using ExternalTaskHandler. Now lets talk about the second concept we had talk above i.e. using Delegate in sprigboot.
In this exercise we wil get the input from bpmn files and then modify it in our java class and then we are transeferring the two values from spring boot class to another Service task in bpmn file service task that will send that values to our other java class using delegate.
Please flow below step religiously
1- Create a bpmn file 2- upload that file on local standalone camunda server. 3- Write java class with ExternalTaskHandler that will take input parameter from bpmn files. 4- finally we will modify this input paramter and send it back to another bpmn service which send the data to java class using delegate and will dispaly the modified values.
lets start
1- Create a bpmn file:-
Please follow below steps.
2- upload that file on local standalone camunda server.
Start you standalone camunda server and login to the tasklist using demo/demo.
follow below steps to upload bpmn files.
Go to below url and start the process.
check the process is imported properly using belwo url
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.siddhu</groupId>
<artifactId>siddhu-external-delegate</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>siddhu-external-delegate</name>
<description>This example shows calling Java class from Camunda Process using handler and then sending value back to another java class using delegate via Service task </description>
Now first stop the standalone server and Now lets start our this application and check if we are getting this modified value inside our java class from next service task
now start our siddhu-external-delegate project
Now lets upload our bpnm file using moduler
Now lets start our deployed process
Check the values in our java programe
now you might be thinking was is difference between ExternalTaskHandler and delegate let me try to expalin the same as we have use these both concept here.