Kindly share an example of creating custom “Local Variables” ?
I was trying to add a “Property” using “Extensions” for a task in a BPM process. Is it the same as your advice ?
We need to use custom forms when tasks are referred to by external system. So, we need to store something like an “externalFormId” per task.
I just noticed that there are no “Extensions” or “Add Property” for tasks / activities in CMMN.
We need this solution to work similarly for both BPM processes, and CMMN.
How can I create custom variable for each task, and access it using REST API ?
Yes, I did explore the formKey field.
I can store an external Id there which the other system can fetch through REST API.
But IMHO, that limits any future capability where we would like to use “embedded forms” when accessing the same flow withing Camunda. Is there a way that I can use embedded forms, along with passing a custom Id to an external system using formKey ?
I am new to Camunda. Kindly correct me if I am wrong in my understanding.
Interesting use case. Have you thought about just storing a mapping between the formkeys and the external system forms. Could even use camunda dmn for this.
The formId that we need to store is very specific to an external system. So, the same needs to be returned to the calling system one way or the other.
Yes, I explored using DMN table as a mapping table. However, I guess that would need 2 API calls.
One on the task, and then a second API call on the DMN to get the corresponding externalFormId.
Ideally, we would like to achieve it in a single REST API call.
Kindly advise if my understanding of Camunda system is correct.
The external system is managed by a separate team.
I would still like to retain some level of control in the long term
Nevertheless, I did try with Extensions and Process Properties as well.
However, one, they are not accessible in the API.
Also, that is not an option with CMMN
Multiple tasks in a process or case complicates it even further.
I think we should consider giving it as an option where the user might want to have custom properties defined at any level (tasks / activities / BPM process / CMMN case, etc.)
Many thanks for your inputs Stephen and Philipp.
Let me try some workarounds if there is no straight jacket way to handle this !
@nitin you could create some middleware to do the double API call / logic between camunda and the external system. You could deploy this on the same camunda server as a JAX-RS or just build as some sort of microservice.
This seems like a good idea, Stephen. Thanks for the tip !
I’ll continue my research into all the workarounds, and let’s see what’s the best that I can come up with.
Building and deploying a middleware to handle this scenario could take a while. I am under pressure at the moment to deliver a workable solution quickly.
Many Thanks for all your inputs Stephen.
Appreciate the time that you’ve put in for this discussion!
Any idea that you might have to setup a quick installation on top of existing Tomcat / Wildfly that we use for Camunda, for setting up the middleware ?
Deploy a Process Application and expose a endpoint using JAX-RS. If you search around in the forum and in the docs, you should see the examples of how to create process applications
I get this error message when I try to cast execution.getBpmnModelElementInstance() to Startevent.
class org.camunda.bpm.model.bpmn.impl.instance.UserTaskImpl cannot be cast to class org.camunda.bpm.model.bpmn.instance.StartEvent (org.camunda.bpm.model.bpmn.impl.instance.UserTaskImpl and org.camunda.bpm.model.bpmn.instance.StartEvent are in unnamed module of loader 'app')
@tsr95 UserTaskImpl is not a type of StartEvent, it should be type of UserTask. You can’t assign to incompatible types, because activity behavior is different for both model instances.
It’s returning a type of UserTask and not the StartEvent