Conditional Properties Panel Entries

Hey Folks,

would it be possible to have Properties Panel entries for specific bpmn-elements to show up only when a certain condition is met? Could I use the rules API to accomplish this?

When digging through the source code I wasn’t able to found something like that this. So I guess I need to implement this functionality myself?

Best regards
Felix

The properties panel displays element-specific properties already. Not all elements have the same porperties, so usually you’d have something like this

if (supportsMyProperty(element)) {
  group.entries = group.entries.push(myEntry(element, ...));
}

You can see one example here.

Hope that helps.

Thanks!

I knew the properties panel entries were dependent on the element selected. But the conditions selected are only of static type and hard-coded. I was a bit unclear in my OP, for me it was about dynamic conditions. I. e. that depend on the model itself. For instance: Only show the properties panel entry if the value of field A is 1. I know this is a bit artificial but you should get the idea.

But the example helps! Now I know where to place such rules.

To answer your question: Yes, this would also work. You could use something like this:

function meetsCriteria(element) {
  return getBusinessObject(element).myProperty === 1;
}

if (meetsCriteria(element)) {
  group.entries = group.entries.push(myEntry(element, ...));
}