/*********************************************************************************************************************** | |
* Copyright (c) 2010 Attensity Europe GmbH. All rights reserved. This program and the accompanying materials are made | |
* available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at | |
* http://www.eclipse.org/legal/epl-v10.html | |
**********************************************************************************************************************/ | |
package org.eclipse.smila.processing.designer.model.record.util; | |
import org.eclipse.bpel.model.Process; | |
import org.eclipse.bpel.model.adapters.INamespaceMap; | |
import org.eclipse.bpel.model.util.BPELUtils; | |
/** | |
* Utils for the Record package. | |
* | |
* Copyright (c) 2010 Attensity Europe GmbH | |
* | |
* @author Lars Kunze | |
*/ | |
public class RecordUtils { | |
/** | |
* Adds the SMILA namespace to the given process | |
* | |
* @param process | |
* @return the preferred namespace prefix | |
*/ | |
public static String addNamespace(Process process) { | |
String nsPrefix = RecordConstants.NS_PREFIX; | |
if (process != null) { // FIXME: Workaround for jUnit tests | |
String nsURI = RecordConstants.NS_URI; | |
INamespaceMap<String, String> nsMap = BPELUtils.getNamespaceMap(process); | |
nsMap.put(nsPrefix, nsURI); | |
} | |
return nsPrefix; | |
} | |
} |