Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KADMOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LR-FPP-MDO
KADMOS
Commits
640f727b
Commit
640f727b
authored
7 years ago
by
imcovangent
Browse files
Options
Downloads
Patches
Plain Diff
Added new method add_dc() to CMDOWS class (used in KE-chain projects).
Former-commit-id: 8124861c35228c9c429225dd8432ff1a05e70f7c
parent
22e5aec3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kadmos/cmdows/cmdows.py
+26
-0
26 additions, 0 deletions
kadmos/cmdows/cmdows.py
with
26 additions
and
0 deletions
kadmos/cmdows/cmdows.py
+
26
−
0
View file @
640f727b
...
...
@@ -301,6 +301,32 @@ class CMDOWS(object):
raise
IOError
(
'
Invalid type for roles provided: {}.
'
.
format
(
type
(
roles
)))
return
def
add_dc
(
self
,
uid
,
id
,
mode_id
,
instance_id
,
version
,
label
):
"""
Method to add a designCompetence element to the designCompetences branch.
"""
# Assert that there is a path to the designCompetences element or add one
parent_element
=
self
.
ensure_abs_xpath
(
'
/cmdows/executableBlocks/designCompetences
'
)
# Assert that there is no existing element with the uid
try
:
self
.
get_element_of_uid
(
uid
)
raise
AssertionError
(
'
UID {} is already used in the CMDOWS file at {}
'
.
format
(
uid
,
self
.
get_xpath_of_uid
(
uid
)))
except
:
pass
# Add the design competence details
dc_element
=
Element
(
'
designCompetence
'
,
uID
=
uid
)
dc_element
.
add
(
'
ID
'
,
id
)
dc_element
.
add
(
'
modeID
'
,
mode_id
)
dc_element
.
add
(
'
instanceID
'
,
instance_id
)
dc_element
.
add
(
'
version
'
,
version
)
dc_element
.
add
(
'
label
'
,
label
)
parent_element
.
append
(
dc_element
)
return
def
add_dc_general_info
(
self
,
dc_uid
,
description
,
status
=
None
,
creation_date
=
None
,
owner_uid
=
None
,
creator_uid
=
None
,
operator_uid
=
None
,
model_definition
=
None
):
"""
Method to add a general info element to a dc branch.
"""
...
...
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