blob: 4c0d025f20769892bb1f341aa3606d6ad58688f9 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* 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
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
*
*
* This copyright notice shows up in the generated Java code
*
*/
package org.eclipse.osbp.xtext.perspective.validation
import org.eclipse.osbp.xtext.perspective.Activator
import org.eclipse.osbp.xtext.perspective.Perspective
import org.eclipse.osbp.xtext.perspective.PerspectiveDslPackage
import org.eclipse.xtext.validation.Check
import org.osgi.framework.Bundle
/**
* Custom validation rules.
*
* see http://www.eclipse.org/Xtext/documentation.html#validation
*/
class PerspectiveDslValidator extends AbstractPerspectiveDslValidator {
@Check
def checkBPMlicensed(Perspective pers) {
if ((pers.process != null)) {
for (Bundle b : Activator.getContext().getBundles()) {
if (b.getSymbolicName().equals("net.osbee.bpm")) {
return;
}
}
info(
'''BPM is needed and not yet licensed. License BPM at www.osbee.net''',
pers,
PerspectiveDslPackage.Literals.PERSPECTIVE__PROCESS)
}
}
}