Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 47 additions & 2 deletions src/components/modeler/Modeler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@
fill: '#1572C2',
strokeWidth: 0,
},
text: { text: event.number , fill: 'white', fontSize: 20, fontWeight: 'bold'},

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / setup

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (10)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (6)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (7)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (0)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (1)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (2)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (8)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (9)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (3)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (5)

A space is required before '}'

Check warning on line 630 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (4)

A space is required before '}'
},
});

Expand Down Expand Up @@ -1071,7 +1071,7 @@
},
validateIfAutoValidateIsOn() {
if (this.autoValidate) {
this.validateBpmnDiagram();
this.safeRevalidate();
}
},
translateConfig(inspectorConfig) {
Expand Down Expand Up @@ -1114,9 +1114,52 @@
if (!store.getters.globalProcesses || store.getters.globalProcesses.length === 0) {
await store.dispatch('fetchGlobalProcesses');
}

this.validationErrors = await this.linter.lint(this.definitions);

// Filter out false positive validation errors for properly configured PM Blocks
this.filterFalsePositivePMBlockErrors();

this.$emit('validate', this.validationErrors);
},
filterFalsePositivePMBlockErrors() {
// Filter out false positive validation errors for properly configured PM Blocks
if (this.validationErrors['processmaker/call-activity-child-process']) {
const originalErrors = this.validationErrors['processmaker/call-activity-child-process'];
const filteredErrors = originalErrors.filter(error => {
// Find the corresponding node
const node = this.nodes.find(n => n.definition.id === error.id);
if (!node || !node.isBpmnType('bpmn:CallActivity')) {
return true; // Keep the error if we can't find the node
}

// Check if the PM Block is properly configured
const hasCalledElement = node.definition.calledElement && node.definition.calledElement !== '';
const hasConfig = node.definition.config && node.definition.config !== '{}';

if (!hasCalledElement || !hasConfig) {
return true; // Keep the error if the PM Block is genuinely unconfigured
}

// Parse the config and check for required fields
try {
const config = JSON.parse(node.definition.config);
const hasProcessId = config.processId && config.processId !== null;
const hasStartEvent = config.startEvent && config.startEvent !== null;

// If PM Block is properly configured, remove the error; otherwise keep it
return !(hasProcessId && hasStartEvent);
} catch (error) {
if (error instanceof SyntaxError) {
return true; // Keep the error if config is invalid JSON or parsing fails
}
throw error;
}
});

this.validationErrors['processmaker/call-activity-child-process'] = filteredErrors;
}
},
setPools(poolDefinition) {
if (!this.collaboration) {
this.collaboration = this.moddle.create('bpmn:Collaboration');
Expand Down Expand Up @@ -1176,7 +1219,7 @@
}
},
registerStatusBar(component) {
this.owner.validationBar.push(component);

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / setup

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (10)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (6)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (7)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (0)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (1)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (2)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (8)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (9)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (3)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (5)

Unexpected mutation of "owner" prop

Check warning on line 1222 in src/components/modeler/Modeler.vue

View workflow job for this annotation

GitHub Actions / e2e (4)

Unexpected mutation of "owner" prop
},
/**
* Register a mixin into a node component.
Expand Down Expand Up @@ -1610,7 +1653,7 @@
await this.$nextTick();
await this.paperManager.awaitScheduledUpdates();
if (this.autoValidate) {
this.validateBpmnDiagram();
this.safeRevalidate();
}
},

Expand Down Expand Up @@ -2560,6 +2603,7 @@
async safeRevalidate() {
// Run bpmnlint only when auto-validate is enabled and the model is ready.
if (!this.autoValidate) return;

// Wait for Vue and JointJS to settle before validating, so we don't lose errors
await this.$nextTick();
if (this.paperManager?.awaitScheduledUpdates) {
Expand Down Expand Up @@ -2615,6 +2659,7 @@
this.initTransparentDragging();
this.test = true;
this.adjustPaperPosition();
this.safeRevalidate();
},
};
</script>
Expand Down
Loading