A few more fixes to prevent bugs from showing up later ...

* Deleting a pool was erroring out when it contained a list of data objects, now it works ok.
* We were getting duplicate DataObjectReferences in the XML when doing a copy paste operation.  Duplicates are no longer generated.
This commit is contained in:
danfunk 2023-06-28 16:44:39 -04:00
parent f40cecc05e
commit d46741ffdb
2 changed files with 8 additions and 1 deletions

View File

@ -36,6 +36,9 @@ export function findDataObject(process, id) {
}
export function findDataObjectReferences(children, dataObjectId) {
if (children == null) {
return [];
}
return children.flatMap((child) => {
if (child.$type == 'bpmn:DataObjectReference' && child.dataObjectRef.id == dataObjectId)
return [child];

View File

@ -41,8 +41,12 @@ export default class DataObjectInterceptor extends CommandInterceptor {
// The parent could be null if it's being deleted, and I could probably handle that here instead of
// when the shape is deleted, but not interested in refactoring at the moment.
if (realParent != null) {
console.log('Pushing', businessObject);
const flowElements = realParent.get('flowElements');
flowElements.push(businessObject);
const existingElement = flowElements.find(i => i.id === 1);
if (!existingElement) {
flowElements.push(businessObject);
}
}
} else if (is(businessObject, 'bpmn:DataObject')) {
// For data objects, only update the flowElements for new data objects, and set the parent so it doesn't get moved.