blob: 58e94145d63450afc4dd78a90ccf5860df4fda16 [file] [log] [blame]
/***********************************************************************************************************************
* 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.processor.util;
import org.eclipse.bpel.model.Process;
import org.eclipse.bpel.model.adapters.INamespaceMap;
import org.eclipse.bpel.model.util.BPELUtils;
import org.eclipse.smila.processing.designer.model.processor.ProcessorPackage;
/**
* Utils for the Processor Package.
*
* Copyright (c) 2010 Attensity Europe GmbH
*
* @author Lars Kunze
*/
public class ProcessorUtils {
/**
* Adds the SMILA namespace to the given process
*
* @param process
* @return the preferred namespace prefix
*/
public static String addNamespace(Process process) {
String nsPrefix = ProcessorPackage.eINSTANCE.getNsPrefix();
if (process != null) { // FIXME: Workaround for jUnit tests
String nsURI = ProcessorConstants.NS_URI;
INamespaceMap<String, String> nsMap = BPELUtils.getNamespaceMap(process);
nsMap.put(nsPrefix, nsURI);
}
return nsPrefix;
}
}