1 .. This work is a derivative of https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-100023263
2 .. This work is licensed under a Creative Commons Attribution 4.0
3 .. International License. http://creativecommons.org/licenses/by/4.0
4 .. Copyright (C) 2020 Deutsche Telekom AG.
13 **Workflow Scope within CDS Framework**
15 The workflow is within the scope of the micro provisioning and configuration
16 management in **controller domain** and does NOT account for the MACRO service orchestration workflow which is covered by the SO Project.
18 A workflow defines an overall action to be taken on the service, hence is an
19 entry-point for the run-time execution of the :ref:`CBA Package <cba>`.
21 A workflow also defines **inputs** and **outputs** that will defined the **payload contract**
22 of the **request** and **response** (see :ref:`dynamic_payload`)
24 A workflow can be **composed** of one or multiple **sub-actions** to execute.
26 A CBA package can have as **many workflows** as needed.
28 .. _workflow_single_action:
33 The workflow is directly backed by a component (see :ref:`node_type` -> Component).
35 In the example bellow, the target of the workflow's steps resource-assignment is ``resource-assignment``
36 which actually is the name of the ``node_template`` defined after, of type ``component-resource-resolution``.
39 <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L40-L71>`_
46 "topology_template": {
48 "resource-assignment": {
50 "resource-assignment": {
51 "description": "Resource Assign Workflow",
52 "target": "resource-assignment"
57 "resource-assignment-properties": {
58 "description": "Dynamic PropertyDefinition for workflow(resource-assignment).",
60 "type": "dt-resource-assignment-properties"
68 "resource-assignment",
76 "resource-assignment": {
77 "type": "component-resource-resolution",
79 "ResourceResolutionComponent": {
83 "artifact-prefix-names": [
92 "vf-module-1-template": {
93 "type": "artifact-template-velocity",
94 "file": "Templates/vf-module-1-template.vtl"
96 "vf-module-1-mapping": {
97 "type": "artifact-mapping-resource",
98 "file": "Templates/vf-module-1-mapping.json"
106 .. _workflow_multiple_actions:
109 **********************
111 The workflow is backed by a Directed Graph engine, dg-generic (see :ref:`node_type` -> DG,
112 and is an **imperative** workflow.
114 A DG used as workflow for CDS is composed of multiple execute nodes; each individual
115 execute node refers to an modelled Component (see :ref:`node_type` -> Component) instance.
117 In the example above, you can see the target of the workflow's steps execute-script is
118 ``execute-remote-ansible-process``, which is a node_template of type ``dg_generic``
121 <https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Definitions/remote_scripts.json#L184-L204>`_
124 :caption: **workflow plan example**
127 "topology_template": {
129 "execute-remote-ansible": {
132 "description": "Execute Remote Ansible Script",
133 "target": "execute-remote-ansible-process"
150 "execute-remote-ansible-properties": {
151 "description": "Dynamic PropertyDefinition for workflow(execute-remote-ansible).",
153 "type": "dt-execute-remote-ansible-properties"
157 "ansible-variable-resolution": {
161 "resolve-ansible-vars",
166 "prepare-environment-logs": {
170 "execute-remote-ansible",
171 "prepare-environment-logs"
175 "execute-command-logs": {
179 "execute-remote-ansible",
180 "execute-command-logs"
186 "execute-remote-ansible-process": {
187 "type": "dg-generic",
192 "dg-execute-remote-ansible-process"
195 "dependency-node-templates": [
196 "resolve-ansible-vars",
197 "execute-remote-ansible"
201 "dg-execute-remote-ansible-process": {
202 "type": "artifact-directed-graph",
203 "file": "Plans/CONFIG_ExecAnsiblePlaybook.xml"
211 Properties of a workflow
212 **************************
221 - Defines the name of the action that can be triggered by external system
223 - | They are two types of inputs, the dynamic ones, and the static one.
230 Specified at workflow level
232 * can be inputs for the Component(s), see the inputs section of the component of interest.
233 * represent inputs to derived custom logic within scripting
235 These will end up under ``${actionName}-request`` section of the payload (see Dynamic API)
239 Represent the resources defined as input (see :ref:`node_type` -> Source -> Input)
240 within mapping definition files (see :ref:`artifact_type` -> Mapping).
242 The **enrichment process** will (see :ref:`enrichment`)
244 * dynamically gather all of them under a data-type, named ``dt-${actionName}-properties``
245 * will add it as a input of the workflow, as follow using this name: ``${actionName}-properties``
247 Example for workflow named `resource-assignment`:
250 :caption: **dynamic input**
252 "resource-assignment-properties": {
254 "type": "dt-resource-assignment-properties"
258 - | Defines the outputs of the execution; there can be as many output as needed.
259 | Depending on the Component (see :ref:`node_type` -> Component) of use, some attribute might be retrievable.
267 * - data type (complex / primitive)
268 - value resolvable using :ref:`expression` -> get_attribute
270 - | Defines the actual step to execute as part of the workflow
281 - | a node_template implementing on of the supported Node Type (see :ref:`node_type` -> DG),
282 either a Component or a DG
283 | (see :ref:`workflow_single_action` or :ref:`workflow_multiple_actions`)
288 :caption: **workflow example**
292 "resource-assignment": { <- workflow-name
294 "vnf-id": { <- static inputs
298 "resource-assignment-properties": { <- dynamic inputs
300 "type": "dt-resource-assignment-properties"
304 "call-resource-assignment": { <- step-name
305 "description": "Resource Assignment Workflow",
306 "target": "resource-assignment-process" <- node_template targeted by the step
310 "template-properties": { <- output
311 "type": "json", <- complex type
313 "get_attribute": [ <- uses expression to retrieve attribute from context
314 "resource-assignment",
324 `TOSCA definition <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454203>`_