modelProperty: reference the conditionExpression for a sequenceFlow


#1

hi ,
maybe its a silly question but i need help

how can i reference the conditionExpression to the modelProperty from the sequenceFlow businessObject
for exemple if open the diagram in my designer, select the sequencFlow in which the value is ${a == 2 && b == 3} and write ${foo == “bar”} in the textBox area the result i get is ${a == 2 && b == 3}=${foo == bar}
i set the model property to => modelProperty: element.businessObject.conditionExpression.body so i’m getting the value of the condition as a reference
any help please
best regards


#2

Can you share some code? I’m not entirely sure I understand what you’re doing.


#3
if (element.businessObject.$type === 'bpmn:SequenceFlow' ) {
        return tabs.concat({
          id: 'extensionElements',
          label: this.translate('extensions'),
           groups: [
            {
              id: 'condition',
              label: this.translate('condition'),
              entries: [
                  EntryFactory.textBox({
                  id: 'expression',
                  label: this.translate('expression'),
                  modelProperty: element.businessObject.conditionExpression.body
                }),

              ]
            }
          ]
        });
      }```

#4
<sequenceFlow 
  id="flow18"
  sourceRef="startEvent1"
  targetRef="parallelgateway5"
  ${bar == foo}="${foo == bar}">
  <conditionExpression xsi:type="tFormalExpression">
    ${bar == foo}
  </conditionExpression>
</sequenceFlow>

#5

when i type foo == bar in the textBox area i get the result as shown below


#6

So you’re trying to edit the condition expression of conditional sequence flows using the properties panel?


#8

yap and after that edit the mail task attributes such as sender reciever cc and usertask form property so i need to find a mechanism


#9

You can already edit the condition expression using the properties panel, right?

image


#11

no

image


#12

According to the BPMN 2.0 specification the following elements can be sources of conditional sequence flows:

  • activity
  • exclusive gateway
  • inclusive gateway
  • complex gateway

A start event is not one of them.


#14

i got this for other flows
image


#15

You’re probably not including the CamundaPropertiesProvider when creating the bpmn-js instance.

import propertiesPanelModule from 'bpmn-js-properties-panel';
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda';

import camundaModdlePackage from 'camunda-bpmn-moddle/resources/camunda';
import camundaModdleExtension from 'camunda-bpmn-moddle/lib';

new BpmnJS({
  additionalModules: [
    camundaModdleExtension,
    propertiesPanelModule,
    propertiesProviderModule
  ],
  moddleExtensions: {
    camunda: camundaModdlePackage
  }
});

#16

thank you for the response, but i i don’t want to use camunda properties provider because i’m using activiti, so i want to customize the properties panel to deal with activiti properties and and namespace, cause i tried to test camunda modeler (the desktop app) and it doesn’t detect activiti attributes ,
best regards


#17

You’d do this in the same manner the properties panel was extended in order to work with Camunda properties.