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
10 * ZTE - initial API and implementation and/or initial documentation
\r
12 package org.onap.sdc.workflowdesigner.converter;
\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
20 import org.slf4j.Logger;
\r
21 import org.slf4j.LoggerFactory;
\r
23 public class Bpmn4Tosca2Bpmn {
\r
25 private static Logger log = LoggerFactory.getLogger(Bpmn4Tosca2Bpmn.class);
\r
28 * Transforms the given BPMN4Tosca Json management into a bpmn plan that can
\r
29 * be excuted by activiti.
\r
32 * @param srcBpmn4ToscaJsonFile
\r
33 * @param targetBpmnArchive
\r
35 public void transform(URI srcBpmn4ToscaJsonFile, URI targetBpmnArchive) {
\r
36 log.info("transform start");
\r
38 // parse json object
\r
40 // transform bpmn template
\r
42 // write bpmn to file
\r
43 log.info("transform end");
\r
46 public static Path writeStringToFile(String content, Path targetPath) throws IOException {
\r
47 return Files.write(targetPath, content.getBytes(), StandardOpenOption.CREATE_NEW);
\r