We have an Angular application which uses bpmn-js and includes property panel & Camunda moddle extensions. Many of the diagrams we create has service tasks. For each service task, we have to configure a connector and input/output parameters. Configuration of connector is a repeated task and involves the same parameters most of the time. This is a hassle for the end user and for improving the user experience we are planning the following
1. Add a service task element in the palette to avoid the extra step of changing the type after dragging and dropping a task element.
2. Creating a configuration interface in the application to pre-configure the connector parameters. (This is out of scope of the topic in discussion)
3. Create a custom property panel where the pre-configured connectors can be listed and on selection the values are mapped in the diagram xml.
I was able to create a custom palette and properties panel with help from your examples. For property panel, I used the General tab and modified. Not sure though if this is the correct way. Below is the screenshot of what was done.
The task dropdown in the property panel is where we can select the configured connectors. Beyond this I couldn’t progress as I couldn’t figure out how to move forward. What I’m looking for is that, on selecting a task, the connector parameters (shown below) should be displayed below the task dropdown.
We could also avoid displaying the parameters but the diagram xml should contain these as given below
<bpmn:serviceTask id="Activity_0uvaugq" name="Get User Details">
<bpmn:extensionElements>
<camunda:connector>
<camunda:inputOutput>
<camunda:inputParameter name="headers">
<camunda:map>
<camunda:entry key="Authorization">${bearerToken}</camunda:entry>
<camunda:entry key="Content-Type">application/scim+json</camunda:entry>
</camunda:map>
</camunda:inputParameter>
<camunda:inputParameter name="method">GET</camunda:inputParameter>
<camunda:inputParameter name="url">https://dev.aaas.hidcloud.com/scim/${tenantId}/v2/Users/${inputUserId}</camunda:inputParameter>
<camunda:outputParameter name="GetUserStatuscode">${statusCode}</camunda:outputParameter>
<camunda:outputParameter name="GetUserDetailsResp">${response}</camunda:outputParameter>
</camunda:inputOutput>
<camunda:connectorId>http-connector</camunda:connectorId>
</camunda:connector>
</bpmn:extensionElements>
<bpmn:incoming>Flow_1nvf6dd</bpmn:incoming>
<bpmn:outgoing>Flow_0lhgmxy</bpmn:outgoing>
</bpmn:serviceTask>
Is this achievable? If so, can you please provide some guidance on how this can be done?
The Github repository for what I have done can be accessed from GitHub - sangeeth-repo/ng-bpmn-js: bpmnjs in Angular. I tried to create a running application in codesandbox and stackblitz but unfortunately it’s failing due to dependency issues. But it works fine when run locally.
Do let me know if you need any other inputs.