renamed message correlation array to correlation properties w/ burnettk cullerton

This commit is contained in:
jasquat 2022-08-17 14:24:37 -04:00
parent 857226f660
commit cdde899f2e
3 changed files with 12 additions and 70 deletions

View File

@ -1,21 +1,6 @@
import { useService } from 'bpmn-js-properties-panel';
import {
isTextFieldEntryEdited,
ListGroup,
TextFieldEntry,
SimpleEntry,
} from '@bpmn-io/properties-panel';
import { without } from 'min-dash';
import { is } from 'bpmn-js/lib/util/ModelUtil';
import {
findDataObjects,
findDataReferenceShapes,
} from '../../DataObject/DataObjectHelpers';
import {
findCorrelationProperties,
findCorrelationKeys,
getRoot,
} from '../MessageHelpers';
import { SimpleEntry } from '@bpmn-io/properties-panel';
import { findCorrelationKeys } from '../MessageHelpers';
/**
* Provides a list of data objects, and allows you to add / remove data objects, and change their ids.
@ -23,13 +8,10 @@ import {
* @constructor
*/
export function CorrelationKeysArray(props) {
const { moddle } = props;
const { element } = props; // fixme: Is it a shape or a moddle element?
const { commandStack } = props;
const { elementRegistry } = props;
const correlationProperties = findCorrelationKeys(element.businessObject);
const items = correlationProperties.map((correlationProperty, index) => {
const items = correlationProperties.map((correlationProperty, _index) => {
const id = `correlationGroup-${correlationProperty.name}`;
return {
id,
@ -44,57 +26,18 @@ export function CorrelationKeysArray(props) {
};
});
// function add(event) {
// event.stopPropagation();
// const newCorrelationKey = moddle.create('bpmn:CorrelationKey');
// newCorrelationKey.name = moddle.ids.nextPrefixed('CorrelationKey_');
// console.log('newCorrelationKey', newCorrelationKey);
// commandStack.execute('element.updateModdleProperties', {
// element,
// moddleElement: element.businessObject,
// newElements: newCorrelationKey,
// });
// }
return { items };
}
function removeFactory(props) {
const { element, dataObject, process, commandStack } = props;
return function (event) {
event.stopPropagation();
commandStack.execute('element.updateModdleProperties', {
element,
moddleElement: process,
properties: {
flowElements: without(process.get('flowElements'), dataObject),
},
});
// Also update the label of all the references
const references = findDataReferenceShapes(element, dataObject.id);
for (const cpRef of references) {
commandStack.execute('element.updateProperties', {
element: cpRef,
moddleElement: cpRef.businessObject,
properties: {
name: '???',
},
changed: [cpRef], // everything is already marked as changed, don't recalculate.
});
}
};
}
// <bpmn:correlationKey name="lover"> <--- The CorrelationKeyGroup
// <bpmn:correlationPropertyRef>lover_name</bpmn:correlationPropertyRef>
// <bpmn:correlationPropertyRef>lover_instrument</bpmn:correlationPropertyRef>
// </bpmn:correlationKey>
// <bpmn:correlationKey name="singer" />
function correlationGroup(props) {
const { element, correlationProperty } = props;
const { correlationProperty } = props;
const id = `correlation-${correlationProperty.name}`;
return correlationProperty.refs.map((cpRef, index) => {
return correlationProperty.refs.map((cpRef, _index) => {
return {
id: `${id}-${cpRef.id}-group`,
component: CorrelationKeyTextField,
@ -105,12 +48,11 @@ function correlationGroup(props) {
}
function CorrelationKeyTextField(props) {
const { id, element, parameter, correlationProperty, cpRef } = props;
const { id, parameter, cpRef } = props;
const commandStack = useService('commandStack');
const debounce = useService('debounceInput');
const getValue = (parameter) => {
const getValue = (_parameter) => {
return cpRef.id;
};

View File

@ -10,7 +10,7 @@ import { findFormalExpressions } from '../MessageHelpers';
/**
* Allows the creation, or editing of messageCorrelations at the bpmn:sendTask level of a BPMN document.
*/
export function MessageCorrelationsArray(props) {
export function CorrelationPropertiesArray(props) {
const { moddle } = props;
const { element } = props;
const { commandStack } = props;

View File

@ -4,7 +4,7 @@ import { CorrelationKeysArray } from './CorrelationKeysArray';
import { MessageSelect } from './MessageSelect';
import { MessagePayload } from './MessagePayload';
import { MessageVariable } from './MessageVariable';
import { MessageCorrelationsArray } from './MessageCorrelationsArray';
import { CorrelationPropertiesArray } from './CorrelationPropertiesArray';
import { isMessageElement, canReceiveMessage } from '../MessageHelpers';
const LOW_PRIORITY = 500;
@ -132,10 +132,10 @@ function createMessageGroup(
}
entries.push({
id: 'messageCorrelations',
label: translate('Message Correlations'),
id: 'correlationProperties',
label: translate('Correlation Properties'),
component: ListGroup,
...MessageCorrelationsArray({
...CorrelationPropertiesArray({
element,
moddle,
commandStack,