Commit f5d65abb authored by Alexander Philipp Nowosad's avatar Alexander Philipp Nowosad
Browse files

Add check development method before adding to bm process diagram

parent 0ac0b2b5
Pipeline #138958 passed with stages
in 8 minutes and 31 seconds
......@@ -132,10 +132,7 @@
<app-development-methods-selection-form
[contextSituationalFactors]="bmProcess.situationalFactors"
[developmentMethods]="validDevelopmentMethods"
(selectDevelopmentMethod)="
selectDevelopmentMethod(modalElement, $event);
resetSelectDevelopmentMethodModal()
"
(selectDevelopmentMethod)="selectDevelopmentMethod(modalElement, $event)"
></app-development-methods-selection-form>
</div>
</ng-template>
......
......@@ -23,6 +23,7 @@ import { DiagramComponentInterface } from '../shared/diagram-component-interface
import { SituationalFactor } from '../../development-process-registry/method-elements/situational-factor/situational-factor';
import { Artifact } from '../../development-process-registry/method-elements/artifact/artifact';
import { BmProcessService } from '../../development-process-registry/bm-process/bm-process.service';
import { DevelopmentMethodIncompleteModalComponent } from '../development-method-incomplete-modal/development-method-incomplete-modal.component';
@Component({
selector: 'app-bm-process-diagram',
......@@ -255,10 +256,20 @@ export class BmProcessDiagramComponent
async selectDevelopmentMethod(
taskElement,
developmentMethod: DevelopmentMethod
) {
): Promise<void> {
const method = await this.developmentMethodService.get(
developmentMethod._id
);
if (!this.developmentMethodService.isCorrectlyDefined(method)) {
const modal = this.modalService.open(
DevelopmentMethodIncompleteModalComponent
);
const component: DevelopmentMethodIncompleteModalComponent =
modal.componentInstance;
component.developmentMethod = method;
return;
}
this.resetSelectDevelopmentMethodModal();
this.bmProcess.addDecision(taskElement.id, method);
this.bpmnService.selectDevelopmentMethodForProcessTask(
this.modeler,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment