Skip to content

Commit 64d4060

Browse files
Ticket #93 : Display CMMN instance
1 parent cd2de94 commit 64d4060

122 files changed

Lines changed: 1482 additions & 2853 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/CaseManagement.CMMN.Persistence.EF/Persistence/CasePlanInstanceQueryRepository.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public async Task<FindResponse<CasePlanInstanceAggregate>> Find(FindCasePlanInst
4242
result = result.Where(r => r.CasePlanId == parameter.CasePlanId);
4343
}
4444

45+
if (!string.IsNullOrWhiteSpace(parameter.CaseFileId))
46+
{
47+
result = result.Where(r => r.CaseFileId == parameter.CaseFileId);
48+
}
49+
4550
if (MAPPING_WORKFLOWINSTANCE_TO_PROPERTYNAME.ContainsKey(parameter.OrderBy))
4651
{
4752
result = result.InvokeOrderBy(MAPPING_WORKFLOWINSTANCE_TO_PROPERTYNAME[parameter.OrderBy], parameter.Order);

src/CaseManagement.CMMN/CasePlanInstance/Queries/Handlers/SearchCasePlanInstanceQueryHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public async Task<SearchResult<CasePlanInstanceResult>> Handle(SearchCasePlanIns
2323
var result = await _casePlanInstanceQueryRepository.Find(new FindCasePlanInstancesParameter
2424
{
2525
CasePlanId = request.CasePlanId,
26+
CaseFileId = request.CaseFileId,
2627
Count = request.Count,
2728
Order = request.Order,
2829
OrderBy = request.OrderBy,

src/CaseManagement.CMMN/CasePlanInstance/Queries/SearchCasePlanInstanceQuery.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ namespace CaseManagement.CMMN.CasePlanInstance.Queries
88
public class SearchCasePlanInstanceQuery : BaseSearchParameter, IRequest<SearchResult<CasePlanInstanceResult>>
99
{
1010
public string CasePlanId { get; set; }
11+
public string CaseFileId { get; set; }
1112
}
1213
}

src/CaseManagement.CMMN/Persistence/InMemory/InMemoryCaseInstanceQueryRepository.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ public Task<FindResponse<CasePlanInstanceAggregate>> Find(FindCasePlanInstancesP
3333
result = result.Where(_ => _.CasePlanId == parameter.CasePlanId);
3434
}
3535

36+
if (!string.IsNullOrWhiteSpace(parameter.CaseFileId))
37+
{
38+
result = result.Where(_ => _.CaseFileId == parameter.CaseFileId);
39+
}
40+
3641
if (MAPPING_WORKFLOWINSTANCE_TO_PROPERTYNAME.ContainsKey(parameter.OrderBy))
3742
{
3843
result = result.InvokeOrderBy(MAPPING_WORKFLOWINSTANCE_TO_PROPERTYNAME[parameter.OrderBy], parameter.Order);

src/CaseManagement.CMMN/Persistence/Parameters/FindCasePlanInstancesParameter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ namespace CaseManagement.CMMN.Persistence.Parameters
55
public class FindCasePlanInstancesParameter : BaseSearchParameter
66
{
77
public string CasePlanId { get; set; }
8+
public string CaseFileId { get; set; }
89
}
910
}

src/CaseManagement.Website/angularApp/app/bpmns/listfiles/listfiles.component.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, ViewChild } from '@angular/core';
1+
import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
22
import { MatPaginator, MatSort } from '@angular/material';
33
import * as fromAppState from '@app/stores/appstate';
44
import * as fromBpmnFileActions from '@app/stores/bpmnfiles/actions/bpmn-files.actions';
@@ -12,7 +12,8 @@ import { merge } from 'rxjs';
1212
templateUrl: './listfiles.component.html',
1313
styleUrls: ['./listfiles.component.scss']
1414
})
15-
export class ListBpmnFilesComponent implements OnInit {
15+
export class ListBpmnFilesComponent implements OnInit, OnDestroy {
16+
bpmnFilesListener: any;
1617
displayedColumns: string[] = [ 'name', 'nbInstances', 'version', 'status', 'create_datetime', 'update_datetime' ];
1718
@ViewChild(MatPaginator) paginator: MatPaginator;
1819
@ViewChild(MatSort) sort: MatSort;
@@ -23,7 +24,7 @@ export class ListBpmnFilesComponent implements OnInit {
2324
}
2425

2526
ngOnInit() {
26-
this.store.pipe(select(fromAppState.selectBpmnFilesResult)).subscribe((searchBpmnFilesResult: SearchBpmnFilesResult) => {
27+
this.bpmnFilesListener = this.store.pipe(select(fromAppState.selectBpmnFilesResult)).subscribe((searchBpmnFilesResult: SearchBpmnFilesResult) => {
2728
if (!searchBpmnFilesResult) {
2829
return;
2930
}
@@ -34,6 +35,10 @@ export class ListBpmnFilesComponent implements OnInit {
3435
this.refresh();
3536
}
3637

38+
ngOnDestroy(): void {
39+
this.bpmnFilesListener.unsubscribe();
40+
}
41+
3742
onSubmit() {
3843
this.refresh();
3944
}

src/CaseManagement.Website/angularApp/app/bpmns/viewfile/viewfile.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ let caseMgtBpmnModdle = require('@app/moddlextensions/casemanagement-bpmn');
2626
styleUrls: ['./viewfile.component.scss']
2727
})
2828
export class ViewBpmnFileComponent implements OnInit, OnDestroy {
29+
bpmnInstancesListener: any;
30+
bpmnFileListener: any;
2931
displayedColumns: string[] = ['status', 'create_datetime', 'update_datetime', 'nbExecutionPath', 'actions'];
3032
@ViewChild(MatPaginator) paginator: MatPaginator;
3133
@ViewChild(MatSort) sort: MatSort;
@@ -97,15 +99,15 @@ export class ViewBpmnFileComponent implements OnInit, OnDestroy {
9799
this.bpmnInstances$ = searchBpmnInstancesResult.content;
98100
this.length = searchBpmnInstancesResult.totalLength;
99101
});
100-
this.store.pipe(select(fromAppState.selectBpmnFilesResult)).subscribe((res: SearchBpmnFilesResult) => {
102+
this.bpmnInstancesListener = this.store.pipe(select(fromAppState.selectBpmnFilesResult)).subscribe((res: SearchBpmnFilesResult) => {
101103
if (!res) {
102104
return;
103105
}
104106

105107
this.bpmnFiles = res.content;
106108
this.versionFormControl.setValue(this.bpmnFile.version);
107109
});
108-
this.store.pipe(select(fromAppState.selectBpmnFileResult)).subscribe((bpmnFile: BpmnFile) => {
110+
this.bpmnFileListener = this.store.pipe(select(fromAppState.selectBpmnFileResult)).subscribe((bpmnFile: BpmnFile) => {
109111
if (!bpmnFile) {
110112
return;
111113
}
@@ -207,6 +209,8 @@ export class ViewBpmnFileComponent implements OnInit, OnDestroy {
207209

208210
ngOnDestroy(): void {
209211
this.paramsSub.unsubscribe();
212+
this.bpmnInstancesListener.unsubscribe();
213+
this.bpmnFileListener.unsubscribe();
210214
}
211215

212216
ngAfterViewInit() {

src/CaseManagement.Website/angularApp/app/bpmns/viewinstance/view.component.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, ViewChild } from '@angular/core';
1+
import { Component, OnInit, ViewChild, OnDestroy } from '@angular/core';
22
import { MatSnackBar, MatTableDataSource, MatSort, MatDialog } from '@angular/material';
33
import { ActivatedRoute, Router } from '@angular/router';
44
import * as fromAppState from '@app/stores/appstate';
@@ -21,7 +21,9 @@ declare var $: any;
2121
templateUrl: './view.component.html',
2222
styleUrls: ['./view.component.scss']
2323
})
24-
export class ViewBpmnInstanceComponent implements OnInit {
24+
export class ViewBpmnInstanceComponent implements OnInit, OnDestroy {
25+
bpmnFileListener: any;
26+
bpmnInstanceListener: any;
2527
activityStatesDisplayedColumns: string[] = ['state', 'executionDateTime', 'message'];
2628
incomingTokensDisplayedColumns: string[] = ['name', 'content'];
2729
outgoingTokensDisplayedColumns: string[] = ['name', 'content'];
@@ -66,7 +68,7 @@ export class ViewBpmnInstanceComponent implements OnInit {
6668
duration: 2000
6769
});
6870
});
69-
this.store.pipe(select(fromAppState.selectBpmnFileResult)).subscribe((e: BpmnFile) => {
71+
this.bpmnFileListener = this.store.pipe(select(fromAppState.selectBpmnFileResult)).subscribe((e: BpmnFile) => {
7072
if (!e || !e.payload) {
7173
return;
7274
}
@@ -75,7 +77,7 @@ export class ViewBpmnInstanceComponent implements OnInit {
7577
this.refreshCanvas();
7678

7779
});
78-
this.store.pipe(select(fromAppState.selectBpmnInstanceResult)).subscribe((e: BpmnInstance) => {
80+
this.bpmnInstanceListener = this.store.pipe(select(fromAppState.selectBpmnInstanceResult)).subscribe((e: BpmnInstance) => {
7981
if (!e) {
8082
return;
8183
}
@@ -96,6 +98,11 @@ export class ViewBpmnInstanceComponent implements OnInit {
9698
this.refresh();
9799
}
98100

101+
ngOnDestroy(): void {
102+
this.bpmnFileListener.unsubscribe();
103+
this.bpmnInstanceListener.unsubscribe();
104+
}
105+
99106
ngAfterViewInit() {
100107
this.activityStates$.sort = this.activityStatesSort;
101108
}

src/CaseManagement.Website/angularApp/app/cmmns/cmmnfiles/cmmnfiles.module.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/CaseManagement.Website/angularApp/app/cmmns/cmmnfiles/cmmnfiles.module.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)