From 7f3cbfdae4d249f9fcc70feabea29014a09dc798 Mon Sep 17 00:00:00 2001 From: localhorst87 Date: Fri, 25 Oct 2024 09:48:54 +0200 Subject: [PATCH 1/3] fixes #1 --- workflow_utils/stmd-crud/src/constants.js | 3 ++- workflow_utils/stmd-crud/src/stmd_class.js | 24 +++++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/workflow_utils/stmd-crud/src/constants.js b/workflow_utils/stmd-crud/src/constants.js index 239a221..a2a13e9 100644 --- a/workflow_utils/stmd-crud/src/constants.js +++ b/workflow_utils/stmd-crud/src/constants.js @@ -173,4 +173,5 @@ exports.GENERAL_INFORMATION_NAME = GENERAL_INFORMATION_NAME; exports.CLASSIFICATION_PARENT_NAME = CLASSIFICATION_PARENT_NAME; exports.ANNOTATIONS_PARENT_NAME = ANNOTATIONS_PARENT_NAME; exports.RESOURCE_NAME = RESOURCE_NAME; -exports.RESOUCE_REFERENCE_NAME = RESOUCE_REFERENCE_NAME; \ No newline at end of file +exports.RESOUCE_REFERENCE_NAME = RESOUCE_REFERENCE_NAME; +exports.PARTICLE_NAMES = particles; \ No newline at end of file diff --git a/workflow_utils/stmd-crud/src/stmd_class.js b/workflow_utils/stmd-crud/src/stmd_class.js index b0efec1..ef86a46 100644 --- a/workflow_utils/stmd-crud/src/stmd_class.js +++ b/workflow_utils/stmd-crud/src/stmd_class.js @@ -8,7 +8,8 @@ const { ROOT_ELEMENT_NAME, LIFECYCLE_PARENT_NAME, LIFECYCLE_ENTRY_NAMES, - GENERAL_INFORMATION_NAME } = require('./constants'); + GENERAL_INFORMATION_NAME, + PARTICLE_NAMES } = require('./constants'); const {StmdWriter} = require('./stmd_writer'); @@ -1024,9 +1025,11 @@ exports.StmdReader = class StmdReader { } /** - * Find all Rational Tag location + * Returns all particle locations where cdk:Credibility elements are contained + * + * @returns {string[][]} */ - findAllParticleLocation(particleName) { + getAllCredibilityLocations() { let locationList = []; let phaseRawParsed, stepRawParsed, currentLocation; @@ -1036,20 +1039,21 @@ exports.StmdReader = class StmdReader { phaseRawParsed = this.#stmdRawParsed[ROOT_ELEMENT_NAME][phase]; if (phaseRawParsed === undefined) continue; - currentLocation = [ROOT_ELEMENT_NAME, phase]; - this.#addLinks(phaseRawParsed, currentLocation); - // loop through all steps of a phase (stmd:DefineModelRequirements, stmd:DefineParameterRequirements, ...) const stmdStepNames = Object.keys(PHASE_TREE[ROOT_ELEMENT_NAME][phase]); for (let step of stmdStepNames) { stepRawParsed = phaseRawParsed[step]; if (stepRawParsed === undefined) continue; - if (stepRawParsed[particleName] == undefined) continue; - currentLocation = [ROOT_ELEMENT_NAME, phase, step, particleName]; - // this.#addLinks(stepRawParsed, currentLocation); - locationList.push(currentLocation) + + for (let particleName of Object.keys(PARTICLE_NAMES)) { + currentLocation = [ROOT_ELEMENT_NAME, phase, step, particleName]; + let possibleCdkElement = this.getCdkElement(currentLocation); + if (possibleCdkElement.Processing.length > 0 || possibleCdkElement.Evidence.length > 0) + locationList.push(currentLocation); + } } } + return locationList; } } \ No newline at end of file From 6252dd43539af2e0f3ecb4da3fbb252737f305c1 Mon Sep 17 00:00:00 2001 From: localhorst87 Date: Fri, 25 Oct 2024 09:50:35 +0200 Subject: [PATCH 2/3] fixes #1 --- workflow_utils/parse_to_yaml.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow_utils/parse_to_yaml.js b/workflow_utils/parse_to_yaml.js index c29a539..dba1726 100644 --- a/workflow_utils/parse_to_yaml.js +++ b/workflow_utils/parse_to_yaml.js @@ -30,7 +30,7 @@ if (stmdString === undefined) // the locations are given as string arrays like // ["stmd:SimulationTaskMetaData", "stmd:ImplementationPhase", "stmd:ImplementModel", "stc:Rationale"] let stmdCrud = new StmdCrud(stmdString); -var stmdRationales = stmdCrud.findAllParticleLocation("stc:Rationale") +var stmdRationales = stmdCrud.getAllCredibilityLocations(); // create one workflow for each Rationale of a process phase var count = 0; From 2583f26de086d137bcc5579c17de84ed26e4af13 Mon Sep 17 00:00:00 2001 From: Automated Test Pipeline Date: Fri, 25 Oct 2024 07:50:55 +0000 Subject: [PATCH 3/3] Generated new automated all workflow, based on STMD [actions skip] --- .github/workflows/all.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/all.yaml b/.github/workflows/all.yaml index 69a8b4d..3ff75c8 100644 --- a/.github/workflows/all.yaml +++ b/.github/workflows/all.yaml @@ -43,10 +43,10 @@ jobs: git commit -m "Add results [actions skip]" git push No_0_RequirementsPhase_DefineModelRequirements: - uses: virtual-vehicle/gaiax-ci/.github/workflows/No.0.RequirementsPhase.DefineModelRequirements.yaml@main + uses: virtual-vehicle/gaiax-ci/.github/workflows/No.0.RequirementsPhase.DefineModelRequirements.yaml@1-make-pipeline-look-for-cdk-elements-in-all-particles-not-only-in-stcrationale secrets: WRITE_WORKFLOW: ${{secrets.WRITE_WORKFLOW}} No_1_ImplementationPhase_ImplementModel: - uses: virtual-vehicle/gaiax-ci/.github/workflows/No.1.ImplementationPhase.ImplementModel.yaml@main + uses: virtual-vehicle/gaiax-ci/.github/workflows/No.1.ImplementationPhase.ImplementModel.yaml@1-make-pipeline-look-for-cdk-elements-in-all-particles-not-only-in-stcrationale secrets: WRITE_WORKFLOW: ${{secrets.WRITE_WORKFLOW}}