blob: 91dd4d2f8b194d32ceb8ab0c5d669b79757800bd [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2006 Oracle Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Oracle Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.bpel.validator.rules;
/**
* Dependency on the BPEL Validation Model API
*/
import org.eclipse.bpel.validator.model.INode;
import org.eclipse.bpel.validator.model.IProblem;
import org.eclipse.bpel.validator.model.ARule;
/**
* Validates Wait nodes.
*
* @author Michal Chmielewski (michal.chmielewski@oracle.com)
* @date Sep 22, 2006
*
*/
public class WaitValidator extends CActivityValidator {
protected INode untilExpr;
protected INode forExpr;
/**
* Start the validation of this node.
*/
@Override
protected void start () {
super.start();
forExpr = mNode.getNode( ND_FOR );
untilExpr = mNode.getNode( ND_UNTIL );
}
/**
* Do a basic sanity check on the wait activity.
*/
@ARule(
date = "9/22/2006",
desc = "Do a basic sanity check on the wait activity.",
author = "michal.chmielewski@oracle.com",
errors="BPELC_EMPTY_EXPIRATION_SETTING,BPELC_MULTIPLE_EXPIRATION_SETTING"
)
public void rule_BasicSanityCheck_5 () {
IProblem problem;
if (forExpr == null && untilExpr == null) {
// both undefined
problem = createError();
problem.setAttribute(IProblem.CONTEXT, AT_FOR);
problem.fill(
"BPELC_EMPTY_EXPIRATION_SETTING", //$NON-NLS-1$
toString(mNode.nodeName()) );
}
if (forExpr != null && untilExpr != null) {
// both defined
problem = createError();
problem.setAttribute(IProblem.CONTEXT, AT_FOR);
problem.fill(
"BPELC_MULTIPLE_EXPIRATION_SETTING", //$NON-NLS-1$
toString(mNode.nodeName()) );
}
}
/** End of public rule methods.
*
* Other methods are support methods for this class to perform its
* validation function.
*
*/
}