e7d48acecf301f883e9b88180b13fe14c48eb9d5
[sdc/sdc-workflow-designer.git] / sdc-workflow-designer-server / src / main / java / org / onap / sdc / workflowdesigner / converter / Bpmn4Tosca2Bpmn.java
1 /**\r
2  * Copyright (c) 2017 ZTE Corporation.\r
3  * All rights reserved. This program and the accompanying materials\r
4  * are made available under the terms of the Eclipse Public License v1.0\r
5  * and the Apache License 2.0 which both accompany this distribution,\r
6  * and are available at http://www.eclipse.org/legal/epl-v10.html\r
7  * and http://www.apache.org/licenses/LICENSE-2.0\r
8  *\r
9  * Contributors:\r
10  *     ZTE - initial API and implementation and/or initial documentation\r
11  */\r
12 package org.onap.sdc.workflowdesigner.converter;\r
13 \r
14 import java.io.IOException;\r
15 import java.net.URI;\r
16 import java.nio.file.Files;\r
17 import java.nio.file.Path;\r
18 import java.nio.file.StandardOpenOption;\r
19 \r
20 import org.slf4j.Logger;\r
21 import org.slf4j.LoggerFactory;\r
22 \r
23 public class Bpmn4Tosca2Bpmn {\r
24 \r
25     private static Logger log = LoggerFactory.getLogger(Bpmn4Tosca2Bpmn.class);\r
26 \r
27     /**\r
28      * Transforms the given BPMN4Tosca Json management into a bpmn plan that can\r
29      * be excuted by activiti.\r
30      * <p>\r
31      *\r
32      * @param srcBpmn4ToscaJsonFile\r
33      * @param targetBpmnArchive\r
34      */\r
35     public void transform(URI srcBpmn4ToscaJsonFile, URI targetBpmnArchive) {\r
36         log.info("transform start");\r
37 \r
38         // parse json object\r
39 \r
40         // transform bpmn template\r
41 \r
42         // write bpmn to file\r
43         log.info("transform end");\r
44     }\r
45 \r
46     public static Path writeStringToFile(String content, Path targetPath) throws IOException {\r
47         return Files.write(targetPath, content.getBytes(), StandardOpenOption.CREATE_NEW);\r
48     }\r
49 \r
50 }\r