Fix/boundary events values (#97)

* Fix issue 1 : Cancel boundary event

* Current changes

* Fix Boundary Issue for Error & Escalation
This commit is contained in:
Ayoub Ait Lachgar 2024-06-18 19:35:10 +01:00 committed by GitHub
parent 285d154ebe
commit fd7a9489d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 7 deletions

View File

@ -8,6 +8,7 @@ import {
isTextFieldEntryEdited
} from '@bpmn-io/properties-panel';
import { getRoot } from './helpers';
import { hasEventDefinition } from 'bpmn-js/lib/util/DiUtil';
function hasEventType(element, eventType) {
const events = element.businessObject.eventDefinitions;
@ -52,7 +53,16 @@ function getConfigureGroupForType(eventDetails, label, includeCode, getSelect) {
},
];
if (includeCode) {
const boundaryCondition =
is(element, 'bpmn:BoundaryEvent') &&
((hasEventDefinition(element, 'bpmn:ErrorEventDefinition') &&
element.businessObject.eventDefinitions[0].errorRef) ||
(hasEventDefinition(element, 'bpmn:EscalationEventDefinition') &&
element.businessObject.eventDefinitions[0].escalationRef) ||
(hasEventDefinition(element, 'bpmn:SignalEventDefinition') &&
element.businessObject.eventDefinitions[0].signalRef));
if (includeCode && boundaryCondition) {
const codeField = getCodeTextField(eventDetails, `${label} Code`);
entries.push({
id: `${idPrefix}-code`,
@ -64,8 +74,7 @@ function getConfigureGroupForType(eventDetails, label, includeCode, getSelect) {
});
}
if (isCatchingEvent(element)) {
if (isCatchingEvent(element) && boundaryCondition) {
entries.push({
id: `${idPrefix}-variable`,
element,

View File

@ -33,7 +33,7 @@ export default function ExtensionsPropertiesProvider(
elementRegistry,
) {
this.getGroups = function (element) {
return function (groups) {
return function(groups) {
if (is(element, 'bpmn:ScriptTask')) {
groups.push(
createScriptGroup(element, translate, moddle, commandStack),
@ -87,6 +87,7 @@ export default function ExtensionsPropertiesProvider(
createSignalButtonGroup(element, translate, moddle, commandStack),
);
}
if (is(element, 'bpmn:ServiceTask')) {
groups.push(
createServiceGroup(element, translate, moddle, commandStack),

View File

@ -25,13 +25,14 @@ export function SpiffExtensionTextInput(props) {
moddle,
name,
label,
description,
businessObject,
description
} = props;
const debounce = useService('debounceInput');
const { businessObject } = element;
const getValue = () => {
return getExtensionValue(businessObject, name);
const value = getExtensionValue(businessObject, name);
return value;
};
const setValue = (value) => {