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
fc8bea4b
Commit
fc8bea4b
authored
3 years ago
by
Florian Lambers
Browse files
Options
Downloads
Patches
Plain Diff
added activity flags
parent
79532522
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/src/main/java/de/fhmuenster/masterthesis/Testgenerator/migration/MigrationService.java
+40
-24
40 additions, 24 deletions
...asterthesis/Testgenerator/migration/MigrationService.java
with
40 additions
and
24 deletions
Testgenerator/src/main/java/de/fhmuenster/masterthesis/Testgenerator/migration/MigrationService.java
+
40
−
24
View file @
fc8bea4b
...
...
@@ -2,43 +2,31 @@ package de.fhmuenster.masterthesis.Testgenerator.migration;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
import
javax.annotation.PostConstruct
;
import
org.eclipse.emf.common.util.BasicEList
;
import
org.eclipse.emf.common.util.EList
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
de.fhmuenster.masterthesis.Testgenerator.rest.dto.MigrationResultWrapperDTO
;
import
de.fhmuenster.masterthesis.Testgenerator.rest.service.change.ChangeService
;
import
de.fhmuenster.masterthesis.Testgenerator.rest.service.test.TestService
;
import
de.fhmuenster.masterthesis.Testgenerator.yaml.MigrationResultStatus
;
import
de.fhmuenster.masterthesis.Testgenerator.yaml.MigrationYaml
;
import
de.fhmuenster.masterthesis.Testgenerator.yaml.YamlReader
;
import
de.fhmuenster.masterthesis.serialization.TestgeneratorDSLSerializer
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.Flow
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.FlowElement
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.FlowElementReference
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.ManualTaskFlowElement
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.UserTaskFlowElement
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.SequenceFlowElement
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.ServiceTaskFlowElement
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.BusinessRuleTaskFlowElement
;
import
de.fhmuenster.masterthesis.testgeneratorDSL.Flag
;
import
de.fhmuenster.masterthesis.utils.TestgeneratorDSLUtils
;
import
org.camunda.bpm.model.bpmn.instance.SequenceFlow
;
import
org.camunda.bpm.model.bpmn.instance.ServiceTask
;
import
org.camunda.bpm.model.bpmn.instance.ManualTask
;
@Service
public
class
MigrationService
{
private
MigrationYaml
yaml
;
@Autowired
private
ChangeService
changeService
;
...
...
@@ -54,7 +42,6 @@ public class MigrationService {
//Annahme: Flows sind identisch
MigrationResultWrapper
migrationResultWrapper
=
new
MigrationResultWrapper
();
List
<
FlowChangeWrapper
>
result
=
new
ArrayList
<>();
// 1. Schritt: Prüfen, ob in einem Flow neue Elemente hinzugekommen sind
List
<
FlowChangeWrapper
>
activityAddActionResults
=
detectActivityAddActions
(
oldDSL
.
getFlows
(),
newDSL
.
getFlows
());
...
...
@@ -65,20 +52,18 @@ public class MigrationService {
System
.
out
.
println
(
"+++ Neu: "
+
fcw
.
getFlowElement
().
getName
()
+
" ["
+
fcw
.
getActionType
()
+
"] in Flow "
+
fcw
.
getFlow
().
getName
()
+
" mit Status: "
+
fcw
.
getMigrationResult
().
getPriority
());
try
{
newDSL
.
getFlow
(
fcw
.
getFlow
().
getName
()).
setFlag
(
Flag
.
YELLOW
);
try
{
Flag
maxFlag
=
Flag
.
NONE
;
List
<
FlowElementReference
>
fers
=
newDSL
.
getFlow
(
fcw
.
getFlow
().
getName
()).
getInclElements
();
for
(
FlowElementReference
fer
:
fers
)
{
fer
.
setFlag
(
Flag
.
GREEN
);
System
.
out
.
println
(
fer
.
getRef
().
getName
());
if
(
fer
.
getRef
().
getName
().
equals
(
fcw
.
getFlowElement
().
getName
()))
{
Flag
newFlag
=
this
.
convertMigrationResultToFlag
(
fcw
.
getMigrationResult
().
getStatus
());
fer
.
setFlag
(
newFlag
);
maxFlag
=
this
.
calcMaxFlag
(
maxFlag
,
newFlag
);
}
}
//newDSL.getFlow(fcw.getFlow().getName()).getInclElements().clear();
//newDSL.getFlow(fcw.getFlow().getName()).getInclElements().replaceAll(fers);
newDSL
.
getFlow
(
fcw
.
getFlow
().
getName
()).
setFlag
(
maxFlag
);
newDSL
.
serialize
();
}
catch
(
IOException
e
)
{
...
...
@@ -220,4 +205,35 @@ public class MigrationService {
return
globalPriority
;
}
private
Flag
convertMigrationResultToFlag
(
MigrationResultStatus
status
)
{
switch
(
status
)
{
case
GREEN:
return
Flag
.
GREEN
;
case
YELLOW:
return
Flag
.
YELLOW
;
case
RED:
return
Flag
.
RED
;
default
:
return
Flag
.
GREEN
;
}
}
private
Flag
calcMaxFlag
(
Flag
currentFlag
,
Flag
newFlag
)
{
if
(
currentFlag
.
equals
(
Flag
.
NONE
)
&&
(
newFlag
.
equals
(
Flag
.
GREEN
)
||
newFlag
.
equals
(
Flag
.
YELLOW
)
||
newFlag
.
equals
(
Flag
.
RED
)))
{
return
newFlag
;
}
if
(
currentFlag
.
equals
(
Flag
.
GREEN
)
&&
(
newFlag
.
equals
(
Flag
.
YELLOW
)
||
newFlag
.
equals
(
Flag
.
RED
)))
{
return
newFlag
;
}
if
(
currentFlag
.
equals
(
Flag
.
YELLOW
)
&&
(
newFlag
.
equals
(
Flag
.
RED
)))
{
return
newFlag
;
}
return
currentFlag
;
}
}
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