class Bpmn4Tosca2Bpel {

	public void transform(URI srcBpmn4ToscaJsonFile, URI targetBPELArchive) throws ParseException, PlanWriterException {
		//LOGGER.debug("Transforming ");

		Bpmn4JsonParser parser = new Bpmn4JsonParser();//TODO To singleton
		/* Create object representation of Json */
		ManagementFlow managementFlow = parser.parse(srcBpmn4ToscaJsonFile);

		List<Path> planArtefactPaths = new ArrayList<Path>();
		try {
			Path tempPath = FileUtil.createTempDir(DIR_NAME_TEMP_BPMN4TOSCA);

			BpelPlanArtefactWriter writer = new BpelPlanArtefactWriter(managementFlow);

			String plan = writer.completePlanTemplate();
			planArtefactPaths.add(FileUtil.writeStringToFile(plan, Paths.get(tempPath.toString(), FILE_NAME_PLAN)));

			String planWsdl = writer.completePlanWsdlTemplate();
			planArtefactPaths.add(FileUtil.writeStringToFile(planWsdl, Paths.get(tempPath.toString(), FILE_NAME_PLAN_WSDL)));

			String invokerWsdl = writer.completeInvokerWsdlTemplate();
			planArtefactPaths.add(FileUtil.writeStringToFile(invokerWsdl, Paths.get(tempPath.toString(), FILE_NAME_INVOKER_WSDL)));

			String invokerXsd = writer.completeInvokerXsdTemplate();
			planArtefactPaths.add(FileUtil.writeStringToFile(invokerXsd, Paths.get(tempPath.toString(), FILE_NAME_INVOKER_XSD)));

			String deploymentDesc = writer.completeDeploymentDescriptorTemplate();
			planArtefactPaths.add(FileUtil.writeStringToFile(deploymentDesc, Paths.get(tempPath.toString(), FILE_NAME_DEPLOYMENT_DESC)));

			LOGGER.debug("Creating BPEL Archive...");
			Path zipFilePath = FileUtil.createApacheOdeProcessArchive(Paths.get(targetBPELArchive), planArtefactPaths);
			LOGGER.debug("Management plan zip file saved to " + zipFilePath.toString());
		} catch (Exception e) {
			throw new PlanWriterException(e);
		} finally {
			/* Delete created plan artifact files from temp directory */
			try {
				LOGGER.debug("Deleting temporary plan artefact files...");
				FileUtil.deleteFiles(planArtefactPaths);
			} catch (IOException e) {
				throw new PlanWriterException(e);
			}
		}
	}

}