I have a request to change the URL component indicated on the diagram to a Table component. For example, when I click on the URL, there will be a dialog where a set of URL data is obtained from an API. Users can choose the URL they want. What should I do?
I explored the ‘bpmn-js-properties-panel’ and ‘bpmn-js-element-templates’ libraries, but I don’t know where to modify them
If anyone knows, can you tell me? Thank you very much!
you can use templates to modify the fields displayed in the desktop modeler.
refer the documentation: Configuring templates | Camunda 8 Docs
Hi @andyqier88, welcome to the forums! To elaborate on the previous answer, you can fork and update any of the Connector Templates from Camunda; you can find them in the camunda/connectors repository on GitHub. Then you would use the new template in your projects.
As long as the inputs and outputs aren’t renamed, you don’t need to build a custom Connector. However, if you change those names or add new ones, you’ll need to extend the Connector itself also; the the runtime code is available in the same repo above (relevant docs).
However, the templates don’t support the dynamism I think you’re looking for. The options within the template are static, and you can hide/show them based on other selections within the template. It would require, I think, a custom build of Desktop Modeler.
There may be some creative workarounds, though. How often do the URLs change when designing processes? Are they different per user?
Thank you for your reply! I know how to change the template files. In fact, I want to modify the source code of the template rendering UI, then I can change the UI style and it can be combined with the data from our internal system
yeah@nathan.loding Thank you for your reply! We have some internal system data that is tenant isolated, so the URLs chosen by users may be different.In fact, I want to modify the source code of the template rendering UI, then I can change the UI style and it can be combined with the data from our internal system.
From another perspective, what I want to change is the logic of UI rendering based on template JSON. I want to modify the source code of the template rendering UI, then I can change the UI style and it can be combined with the data from our internal system
@andyqier88 - very interesting use case and ask. I don’t think there’s any existing hooks for this, so you would be altering core code, which could be a maintenance headache. But I think it’s an interesting idea! I’ll see if I can get someone from the Modeler or Connector team to provide some direction.
@nathan.loding Thank you for your detailed and serious response. I am sorry that the product manager has changed his requirements: he wants to click first task or click a button on the right panel to request a service api to fetch data
and assign a value to properties panel on the right.
e.g. we get URL data is ‘http://abc.com’,then the URL input
changes ‘http://abc.com’ from ‘http://192.168…’,and Headers,
Query params are the same.
Do you have any good solutions or should I ask other teams?
@andyqier88 - I am now a bit confused on the requirements. Are these API calls you are expecting to happen at modeling time, or are you looking to achieve this after the process has been deployed? The second scenario is supported currently; the first seems like I’m misunderstanding the requirement, because you wouldn’t need a task in the process to fetch data at modeling time.
@nathan.loding Thanks, ignore the first scenario, the second scenario is “click a button on the right panel to request a service api to fetch data to changes some properties values”, right?
If that’s the case, are there any best practices that I can refer to?Or should I alter core code related to the bpmn-js-element-templates package? Maybe Caumnda, Zeebe, or BpmnModel provide some internal methods can i use?
I’m sorry, I’ve asked too many questions
@andyqier88 - as I understand it, you’re still asking about something to occur during the modeling process, not when the process is executed. That is entirely the domain of Modeler. As mentioned before, I believe you’ll need to alter core code in Modeler to achieve this (though I could be very wrong!), but I’d need an engineer from that team to share more detail. I’ve pinged that team again to see if someone can provide some guidance!
@andyqier88 - and I stand corrected by the engineers! They think you should be able to achieve this using a plugin for Desktop Modeler. Here’s some resources they shared to get you started:
- GitHub - camunda/camunda-modeler-plugins: Plugins for the Camunda Modeler. - repository with existing plugins that you can reference
- your plugin will probably be a bpmn-js extension, so they suggested you take a look at this plugin for inspiration: bpmn-js-examples/properties-panel-async-extension at main · bpmn-io/bpmn-js-examples · GitHub
- plugin documentation: Plugins | Camunda 8 Docs
Thank you, I’ll take a look
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.