Determe, Sebastien (sd378r) | 4c14395 | 2017-09-08 12:14:08 +0200 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
ChrisC | 5e9feb2 | 2017-06-21 02:38:57 -0700 | [diff] [blame] | 2 | <!-- |
| 3 | ============LICENSE_START======================================================= |
| 4 | ONAP CLAMP |
| 5 | ================================================================================ |
| 6 | Copyright (C) 2017 AT&T Intellectual Property. All rights |
| 7 | reserved. |
| 8 | ================================================================================ |
| 9 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | you may not use this file except in compliance with the License. |
| 11 | You may obtain a copy of the License at |
| 12 | |
| 13 | http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | |
| 15 | Unless required by applicable law or agreed to in writing, software |
| 16 | distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | See the License for the specific language governing permissions and |
| 19 | limitations under the License. |
| 20 | ============LICENSE_END============================================ |
| 21 | =================================================================== |
ChrisC | 5e9feb2 | 2017-06-21 02:38:57 -0700 | [diff] [blame] | 22 | --> |
| 23 | |
| 24 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 25 | xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"> |
| 26 | <!-- |
| 27 | ** clds-bpmn-transformer.xsl |
| 28 | --> |
| 29 | |
| 30 | <xsl:output method="text" indent="no" omit-xml-declaration="yes" /> |
| 31 | <xsl:strip-space elements="*"/> |
| 32 | |
| 33 | <!-- by default copy all attributes and elements --> |
| 34 | <xsl:template match="/bpmn2:definitions/bpmn2:process"> |
| 35 | |
xg353y | bc25b72 | 2017-09-27 13:21:21 +0200 | [diff] [blame] | 36 | <xsl:text>{"policy":[</xsl:text> |
ChrisC | 5e9feb2 | 2017-06-21 02:38:57 -0700 | [diff] [blame] | 37 | <xsl:for-each select="bpmn2:policy" > |
| 38 | <xsl:call-template name="network-element" /> |
| 39 | </xsl:for-each> |
| 40 | <xsl:text>],</xsl:text> |
| 41 | |
| 42 | <xsl:text>"tca":[</xsl:text> |
| 43 | <xsl:for-each select="bpmn2:tCA" > |
| 44 | <xsl:call-template name="network-element" /> |
| 45 | </xsl:for-each> |
Determe, Sebastien (sd378r) | 4c14395 | 2017-09-08 12:14:08 +0200 | [diff] [blame] | 46 | <xsl:text>],</xsl:text> |
| 47 | |
| 48 | <xsl:text>"holmes":[</xsl:text> |
| 49 | <xsl:for-each select="bpmn2:holmes" > |
| 50 | <xsl:call-template name="network-element" /> |
| 51 | </xsl:for-each> |
| 52 | <xsl:text>],</xsl:text> |
xg353y | bc25b72 | 2017-09-27 13:21:21 +0200 | [diff] [blame] | 53 | |
Determe, Sebastien (sd378r) | 4c14395 | 2017-09-08 12:14:08 +0200 | [diff] [blame] | 54 | <xsl:text>"vesCollector":[</xsl:text> |
| 55 | <xsl:for-each select="bpmn2:vesCollector" > |
| 56 | <xsl:call-template name="network-element" /> |
| 57 | </xsl:for-each> |
ChrisC | 5e9feb2 | 2017-06-21 02:38:57 -0700 | [diff] [blame] | 58 | <xsl:text>]</xsl:text> |
| 59 | |
| 60 | <xsl:text>}</xsl:text> |
| 61 | </xsl:template> |
| 62 | |
| 63 | <xsl:template name="network-element"> |
| 64 | <xsl:variable name="incoming" select="./bpmn2:incoming"/> |
| 65 | |
| 66 | <xsl:text>{"id":"</xsl:text> |
| 67 | <xsl:value-of select="./@id"/> |
| 68 | <xsl:text>", "from":"</xsl:text> |
| 69 | <xsl:value-of select="../bpmn2:sequenceFlow[@id=$incoming]/@sourceRef"/> |
| 70 | <xsl:text>"}</xsl:text> |
| 71 | <xsl:if test="not(position()=last())">, </xsl:if> |
| 72 | </xsl:template> |
| 73 | |
| 74 | </xsl:stylesheet> |