Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PDA Testing Tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
winfo
code-pro
PDA Testing Framework
PDA Testing Tool
Commits
8e5a4fb1
Commit
8e5a4fb1
authored
3 years ago
by
Florian Lambers
Browse files
Options
Downloads
Patches
Plain Diff
updated bpmnjsdiffer
parent
4e000b95
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testgenerator-web/testgenerator-web/src/app/components/update-project/update-project.component.ts
+42
-10
42 additions, 10 deletions
...app/components/update-project/update-project.component.ts
with
42 additions
and
10 deletions
testgenerator-web/testgenerator-web/src/app/components/update-project/update-project.component.ts
+
42
−
10
View file @
8e5a4fb1
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
,
ViewChild
,
ViewChildren
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
...
...
@@ -6,8 +6,11 @@ import { FileService } from 'src/app/services/file.service';
import
{
ProjectService
}
from
'
src/app/services/project.service
'
;
import
{
SingleProjectConfig
}
from
'
src/app/models/single-project-config
'
;
import
*
as
BpmnModdle
from
'
bpmn-moddle
'
;
//import * as BpmnModdle from 'bpmn-moddle';
let
BpmnModdle
=
require
(
'
bpmn-moddle
'
).
default
;
//import BpmnModdle from 'bpmn-moddle';
import
{
diff
}
from
'
bpmn-js-differ
'
;
import
{
BpmnDiagramComponent
}
from
'
../bpmn-diagram/bpmn-diagram.component
'
;
@
Component
({
selector
:
'
app-update-project
'
,
...
...
@@ -23,28 +26,57 @@ export class UpdateProjectComponent implements OnInit {
diagramNew
:
string
;
// updated BPMN-Model
diagramsLoaded
:
boolean
=
false
;
@
ViewChild
(
'
backupDiagram
'
)
backupDiagram
;
@
ViewChild
(
'
newDiagram
'
)
newDiagram
;
constructor
(
private
fileService
:
FileService
,
private
projectService
:
ProjectService
,
private
route
:
ActivatedRoute
)
{
this
.
route
.
params
.
subscribe
(
params
=>
this
.
actualProject
=
params
[
'
projectId
'
]
)
}
async
ngOnInit
()
{
await
this
.
loadProject
();
await
this
.
loadDiagram
();
await
this
.
loadDiagramUpdated
();
}
compareProjects
()
{
async
compareProjects
()
{
var
currentDiagram
,
newDiagram
;
var
diagram1
=
new
BpmnModdle
().
fromXML
(
this
.
diagram
);
var
diagram2
=
new
BpmnModdle
().
fromXML
(
this
.
diagramNew
);
try
{
var
result
=
await
new
BpmnModdle
().
fromXML
(
this
.
diagram
);
currentDiagram
=
result
.
rootElement
;
}
catch
(
err
){
console
.
log
(
'
something went wrong!
'
);
}
var
changes
=
diff
(
diagram1
,
diagram2
);
console
.
log
(
changes
.
_removed
);
}
try
{
var
result
=
await
new
BpmnModdle
().
fromXML
(
this
.
diagramNew
);
newDiagram
=
result
.
rootElement
;
}
catch
(
err
){
console
.
log
(
'
something went wrong!
'
);
}
var
changes
=
diff
(
currentDiagram
,
newDiagram
);
var
container
=
this
.
backupDiagram
.
getBpmnContainer
();
var
canvas
=
container
.
get
(
'
canvas
'
);
for
(
let
element
of
Object
.
keys
(
changes
.
_removed
))
{
canvas
.
addMarker
(
element
,
'
marker-removed
'
);
}
var
newContainer
=
this
.
newDiagram
.
getBpmnContainer
();
var
newCanvas
=
newContainer
.
get
(
'
canvas
'
);
for
(
let
element
of
Object
.
keys
(
changes
.
_added
))
{
newCanvas
.
addMarker
(
element
,
'
marker-added
'
);
}
}
async
loadProject
()
{
try
{
...
...
@@ -58,7 +90,7 @@ export class UpdateProjectComponent implements OnInit {
async
loadDiagram
()
{
try
{
let
result
=
await
this
.
fileService
.
getBPMNDiagram
(
this
.
actualProject
);
let
result
=
await
this
.
fileService
.
getB
ackupB
PMNDiagram
(
this
.
actualProject
);
this
.
diagram
=
result
;
}
finally
{
...
...
@@ -68,7 +100,7 @@ export class UpdateProjectComponent implements OnInit {
async
loadDiagramUpdated
()
{
try
{
let
result
=
await
this
.
fileService
.
get
Updated
BPMNDiagram
(
this
.
actualProject
);
let
result
=
await
this
.
fileService
.
getBPMNDiagram
(
this
.
actualProject
);
this
.
diagramNew
=
result
;
}
finally
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment