hi ,
I am going through the basics of cammunda, can you provide multiple options to invoke an MS from the BPMN External task?
what are the options, how many you can achieve this?
hi ,
I am going through the basics of cammunda, can you provide multiple options to invoke an MS from the BPMN External task?
what are the options, how many you can achieve this?
Hello my friend!
In this link below you will find everything you need to know about external tasks, that is, how the external task pattern works, how to fetch and lock, how to handle errors, how to complete the task, among other important things!
I hope this helps!
William Robert Alves
Thanks @WilliamR.Alves
Can you Pls explain this in Real-time Context?
Question 1 - Internal Service tasks -Synchronous invocation of code deployed along with a process application - Will it insert data in the Cammunda Ru table, can you give more details
Question 2 - what are the tables in involved when it r=usn in background
I don’t know if I understood your question very well, or my English is a little bad…
But come on… (if I don’t understand what you need to know, please let me know).
Question 1 - Internal service tasks is when your code was deployed together with your camunda application, that is, in a service task, which can call Java code such as JavaDelegate or even an inline script in an execution listner. This happens within the context of your application and is therefore called an internal service task. This type of task stores data in the ru tables because as they are executed at runtime, these ru tables store the runtime data.
Question 2 - Regarding the tables updated when working with external tasks, I didn’t memorize them all but I believe they are these:
act_ru_ext_task
= stores information about available ext tasks;act_ru_job
= contains information about internal and external task jobs, updates when the external task is completed;act_ru_variable
= if the external task manipulates variables, this table will also be updated.act_ru_execution
= if an external task affects the process flow, it can also be updated.In addition to these, the history and metrics tables (_hi_
& act_ru_meter_log
) are also updated to store history and metrics in your database if they are enabled.
William Robert Alves
Strong recommendation: Do not access the Camunda DB tables directly. Only access them via the interfaces provided by Camunda. If you access the DB tables, you will likely cause yourself Optimistic Locking Exceptions, and therefore rollbacks.
hi @GotnOGuts
I am checking in the background how the cammunda engine runs, are you saying not ven to run a select query?
Hello @stephenbalben_joel , what @GotnOGuts meant is that if you are thinking about doing some type of transaction at the bank, trying to insert data directly manually or creating your own method to do this, don’t do it!
Always do it through the methods / interfaces that Camunda itself provides you.
but making queries is no problem, as it will not change state in the database, and therefore will not affect the operation of the application.
William Robert Alves
hi @WilliamR.Alves - I am not doing anything in the background. just querying to visualise my understanding
hi @WilliamR.Alves
Need further clarification on external Task
I have BPMN Flows does start - external task (Callout to 3rd party) - End
How time out works in external task, where is the default setting?
Lets take an example:
The “3rd Party Code” is an external task configued like this:
The external task pattern was created to support components outside the process application to participate in a process flow.
This way you can have software components written in different programming languages - .NET, PHP etc. They just need to be able to call the Camunda REST API.
Such components are called external task workers.
To be able to support this, it’s actually not the Camunda process engine that calls these external components. The external components are calling the Camunda REST API asking Camunda for external tasks.
Once the Camunda process engine reaches an external task (the “3rd Party Code” in the example above), a task is created (and stored inside the Camunda DB).
Now Camunda will wait for an external component to mark the task as completed, and only then, the process flow will continue.
External task workers must do the following:
Poll the Camunda API for tasks (using a topic name). If a task is returned it will be claimed and locked by the task worker.
The task worker must run the code needed to complete the task (notice, that this code is executed outside Camunda)
Once the code is completed, the task worker must call the Camunda API to mark the task as completed (or failed if the task worker code fails).
All task workers will run inside such a loop.
Regarding your question about timeout - first of all, if a process reaches an external task, this task will remain there until it is marked as completed.
Only then will the process continue. There is no timeout here.
However, if an external task has been claimed by an external task worker, the task is then locked and assigned to that worker, and if that worker does not complete the task (or mark it as failed) within a given period of time, the lock on the external task will be released and the task will be available for other external task workers (using the same topic name).
This period of time is called “lock duration” and it must be provided when external task workers claim and lock an external task.
So it is the external task workers that specify how long Camunda should keep the lock on a task.
Hope that helps.
BR
Michael