How to add conditional props in properties panel 1.x

In the properties panel 0.x, conditional props could be added to a group with the conditionalProps function (see this Codesandbox).

I cannot find a way to achieve this in the 1.x Version. The ConditionalProps part does not seem to exist anymore, I can’t even seem to find anything called conditionalprops in the entire bpmn.io codebase. Is this still possible (potentially under a different name)?

The conditional properties (e.g. for sequence flows) are still in the bpmn-js-properties-panel version 1: bpmn-js-properties-panel/ConditionProps.js at master · bpmn-io/bpmn-js-properties-panel · GitHub.

Is that what you are looking for?

1 Like

Yes it is, thank you.

Actually, I spoke too early. This is the function I am looking for and it does achieve what I think it should. There is just one small problem: It is not being exported. I would have to add the CamundaPlatformPropertiesProvider to my modeler, but that adds other properties that I do not want. Is there a way to only add the ConditionProps? If I edit the file in my node_modules so that ConditionProps is exported everything works as expected, but that is obviously not a solution.

On a sidenote: Is there a reason why this is not exported? Should I not use ConditionProps on its own?

That’s a good point, we do not actively export single properties via bpmn-js-properties-panel, which is kind of a breaking change comparing it with the 0.x versions, and makes composition of existing properties pretty hard.

I created an issue for this to start a discussion whether this capability should be re-added or not: Export individual properties and entries · Issue #720 · bpmn-io/bpmn-js-properties-panel · GitHub

In the meanwhile, you could also copy the conditional props and the needed helpers. I did this by example and used the props in a custom properties provider: properties panel custom conditional props - CodeSandbox

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.