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

Remove task situational factors from lookup

parent f788d2c2
Pipeline #132793 failed with stages
in 8 seconds
......@@ -31,11 +31,10 @@ export class DevelopmentMethodService {
*
* @param needed needed types
* @param forbidden forbidden types
* @param situationalFactors the situational factors
* @param contextFactors the context factors
*/
getValidDevelopmentMethods(
needed: string[], forbidden: string[], situationalFactors: SituationalFactor[], contextFactors: SituationalFactor[]
needed: string[], forbidden: string[], contextFactors: SituationalFactor[]
) {
return this.pouchdbService.find<DevelopmentMethod>(DevelopmentMethod.typeName, {
selector: {
......@@ -61,7 +60,6 @@ export class DevelopmentMethodService {
}).then((docs) => {
// Work around
docs.docs = docs.docs
.filter((doc) => fulfillsFactors(situationalFactors, doc.situationalFactors))
.filter((doc) => fulfillsFactors(contextFactors, doc.situationalFactors));
return docs;
});
......
......@@ -52,24 +52,6 @@
<div class="alert alert-info" *ngIf="modalElement.businessObject.get('forbiddenType').length === 0">
No forbidden types defined for this task.
</div>
<h5 class="mt-3">Situational Factors</h5>
<table class="table" *ngIf="modalElement.businessObject.get('situationalFactors').length > 0">
<thead>
<tr>
<th scope="col">Situational Factor</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let factor of modalElement.businessObject.get('situationalFactors')">
<td>{{factor.name}}</td>
<td>{{factor.value}}</td>
</tr>
</tbody>
</table>
<div class="alert alert-info" *ngIf="modalElement.businessObject.get('situationalFactors').length === 0">
No situational factors defined for this task.
</div>
</div>
</ng-template>
......
......@@ -89,7 +89,7 @@ export class BmProcessDiagramComponent implements DiagramComponentInterface, OnI
openAddProcessPatternModal(startingElement) {
this.processPatternService.getValidProcessPatterns(
['initialisation'], [], [], this.bmProcess.situationalFactors
['initialisation'], [], this.bmProcess.situationalFactors
).then(list => {
this.modalProcessPatterns = list.docs;
this.modalElement = startingElement;
......@@ -134,7 +134,7 @@ export class BmProcessDiagramComponent implements DiagramComponentInterface, OnI
const businessObject = taskElement.businessObject;
this.developmentMethodService.getValidDevelopmentMethods(
businessObject.get('neededType').map((type) => type.name), businessObject.get('forbiddenType').map((type) => type.name),
businessObject.get('situationalFactors'), this.bmProcess.situationalFactors,
this.bmProcess.situationalFactors,
).then((developmentMethods) => {
this.validDevelopmentMethods = developmentMethods.docs;
if (developmentMethods.docs.length > 0) {
......@@ -171,7 +171,7 @@ export class BmProcessDiagramComponent implements DiagramComponentInterface, OnI
const businessObject = callActivityElement.businessObject;
this.processPatternService.getValidProcessPatterns(
businessObject.get('neededType').map((type) => type.name), businessObject.get('forbiddenType').map((type) => type.name),
businessObject.get('situationalFactors'), this.bmProcess.situationalFactors,
this.bmProcess.situationalFactors,
).then(list => {
this.modalProcessPatterns = list.docs;
this.modalElement = callActivityElement;
......
......@@ -29,11 +29,10 @@ export class ProcessPatternService {
*
* @param needed needed types
* @param forbidden forbidden types
* @param situationalFactors the situational factors
* @param contextFactors the context factors
*/
getValidProcessPatterns(
needed: string[], forbidden: string[], situationalFactors: SituationalFactor[], contextFactors: SituationalFactor[]
needed: string[], forbidden: string[], contextFactors: SituationalFactor[]
) {
return this.pouchdbService.find<ProcessPattern>(ProcessPattern.typeName, {
selector: {
......@@ -59,7 +58,6 @@ export class ProcessPatternService {
}).then((docs) => {
// Work around
docs.docs = docs.docs
.filter((doc) => fulfillsFactors(situationalFactors, doc.situationalFactors))
.filter((doc) => fulfillsFactors(contextFactors, doc.situationalFactors));
return docs;
});
......
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