@SuppressWarnings("unchecked") private ActivityGenerator findActivityGen(Activity source) { Class actClass = source.getClass(); for (Map.Entry<Class, ActivityGenerator> me : _actGenerators.entrySet()) { Class<?> cls = me.getKey(); if (cls.isAssignableFrom(actClass)) { ActivityGenerator gen = me.getValue(); gen.setContext(this); return gen; } } throw new CompilationException(__cmsgs.errUnknownActivity(actClass.getName()).setSource(source)); }
public void compile(OActivity output, Activity src) { FlowActivity flowAct = (FlowActivity)src; OFlow oflow = (OFlow) output; compileLinkDecls(oflow, flowAct); compileChildren(oflow, flowAct); for (Iterator<OLink> i = oflow.localLinks.iterator(); i.hasNext(); ) { OLink olink = i.next(); try { if (olink.source == null) throw new CompilationException(__cmsgs.errLinkMissingSourceActivity(olink.name).setSource(flowAct)); } catch (CompilationException ce) { _context.recoveredFromError(src, ce); } try { if (olink.target == null) throw new CompilationException(__cmsgs.errLinkMissingTargetActivity(olink.name).setSource(flowAct)); } catch (CompilationException ce) { _context.recoveredFromError(src, ce); } } }
protected void compileChildren(OSequence dest, CompositeActivity src) { if (src.getActivities().size() == 0) throw new CompilationException(__cmsgs.errEmptySequence().setSource(src)); for (Activity child : src.getActivities()) { try { OActivity compiledChild = _context.compile(child); dest.sequence.add(compiledChild); } catch (CompilationException ce) { _context.recoveredFromError(child, ce); } } }
CompilationMessage cmsg = __cmsgs.errBpelParseErr().setSource(new SourceLocationImpl(bpelFile.toURI())); this.invalidate(); throw new CompilationException(cmsg, e);
m.severity = CompilationMessage.ERROR; m.code = ""; m.setSource(sourceLocation); m.messageText = "Incompatible copy error: " + toType2 + " := " + fromType2 + " simplified: " + toType3 + " := " + fromType3 + " expression: " + expr; throw new CompilationException(m);
private OProcess.OProperty compile(Property property) { OProcess.OProperty oproperty = new OProcess.OProperty(_oprocess); oproperty.name = property.getName(); oproperty.debugInfo = createDebugInfo(_processDef, "Property " + property.getName()); if (!_wsdlRegistry.getSchemaModel().isSimpleType(property.getPropertyType())) throw new CompilationException(__cmsgs.errPropertyDeclaredWithComplexType(property.getName(), property.getPropertyType()).setSource(property)); _oprocess.properties.add(oproperty); if (__log.isDebugEnabled()) __log.debug("Compiled property " + oproperty); return oproperty; }
public void run() { compileLinks(source); for (OScope.Variable v : variables) { v.declaringScope = implicitScope; implicitScope.addLocalVariable(v); } if (source instanceof ScopeActivity) { Activity scopeChild = ((ScopeActivity) source).getChildActivity(); if (scopeChild == null) throw new CompilationException(__cmsgs.errEmptyScope().setSource(source)); implicitScope.activity = compile(scopeChild); } else { implicitScope.activity = compileActivity(false, source); } } });
private void compileLinkTarget(LinkTarget target) { OLink ol = resolveLink(target.getLinkName()); assert ol != null; ol.debugInfo = createDebugInfo(target, target.toString()); if (ol.target != null) throw new CompilationException(__cmsgs.errDuplicateLinkTarget(target.getLinkName()).setSource(target)); ol.target = _structureStack.topActivity(); _structureStack.topActivity().targetLinks.add(ol); }
private void compileLinkSource(LinkSource linksrc) { OLink ol = resolveLink(linksrc.getLinkName()); assert ol != null; ol.debugInfo = createDebugInfo(linksrc, linksrc.toString()); if (ol.source != null) throw new CompilationException(__cmsgs.errDuplicateLinkSource(linksrc.getLinkName()).setSource(linksrc)); ol.source = _structureStack.topActivity(); ol.transitionCondition = linksrc.getTransitionCondition() == null ? constantExpr(true) : compileExpr(linksrc .getTransitionCondition()); _structureStack.topActivity().sourceLinks.add(ol); _structureStack.topActivity().outgoingLinks.add(ol); }
public void addWsdlImport(URI from, URI wsdlImport, SourceLocation sloc) { Definition4BPEL def; try { WSDLReader r = _wsdlFactory.newWSDLReader(); WSDLLocatorImpl locator = new WSDLLocatorImpl(_resourceFinder, _resourceFinder.resolve(from, wsdlImport)); def = (Definition4BPEL) r.readWSDL(locator); } catch (WSDLException e) { recoveredFromError(sloc, new CompilationException(__cmsgs.errWsdlParseError(e .getFaultCode(), e.getLocation(), e.getMessage()))); throw new CompilationException(__cmsgs.errWsdlImportFailed(wsdlImport.toASCIIString(), e.getFaultCode()) .setSource(sloc), e); } try { _wsdlRegistry.addDefinition(def, _resourceFinder, _resourceFinder.resolve(from, wsdlImport)); if (__log.isDebugEnabled()) __log.debug("Added WSDL Definition: " + wsdlImport); } catch (CompilationException ce) { recoveredFromError(sloc, ce); } }
oalarm.untilExpr = compileExpr(onAlarm.getUntil()); } else if (onAlarm.getFor() != null && onAlarm.getUntil() != null) { throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onAlarm)); } else if (onAlarm.getRepeatEvery() == null) { throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onAlarm)); oalarm.repeatExpr = compileExpr(onAlarm.getRepeatEvery()); if (onAlarm.getActivity() == null) throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onAlarm)); oalarm.activity = compile(onAlarm.getActivity()); throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name).setSource(onAlarm)); } catch (CompilationException ce) { recoveredFromError(onAlarm, ce); throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name).setSource(onAlarm)); } catch (CompilationException ce) { recoveredFromError(onAlarm, ce);
} catch (CompilationException ce) { if (ce.getCompilationMessage().source == null) ce.getCompilationMessage().setSource(expression); throw ce;
public void compile(OActivity output, Activity src) { WaitActivity waitDef = (WaitActivity)src; OWait owait = (OWait)output; if (waitDef.getFor() != null && waitDef.getUntil() == null) { owait.forExpression = _context.compileExpr(waitDef.getFor()); } else if (waitDef.getFor() == null && waitDef.getUntil() != null) { owait.untilExpression = _context.compileExpr(waitDef.getUntil()); } else { throw new CompilationException(_msgs.errWaitMustDefineForOrUntilDuration().setSource(waitDef)); } } }
if (!(faultVar.type instanceof OMessageVarType)) throw new CompilationException(__cmsgs.errMessageVariableRequired( catchSrc.getFaultVariable()).setSource(catchSrc)); break; case BPEL20_DRAFT: && catchSrc.getFaultVariableElementType() == null) throw new CompilationException(__cmsgs.errVariableDeclMissingType( catchSrc.getFaultVariable()).setSource(catchSrc)); if (catchSrc.getFaultVariableMessageType() != null && catchSrc.getFaultVariableElementType() != null) throw new CompilationException(__cmsgs.errVariableDeclMissingType( catchSrc.getFaultVariable()).setSource(catchSrc)); throw new CompilationException(__cmsgs.errEmptyCatch().setSource(catchSrc)); _structureStack.topScope().activity = compile(catchSrc.getActivity());
public void compile(OActivity dest, Activity source) { OAssign oassign = (OAssign) dest; AssignActivity ad = (AssignActivity) source; for (Copy scopy : ad.getCopies()) { OAssign.Copy ocopy = new OAssign.Copy(_context.getOProcess()); ocopy.keepSrcElementName = scopy.isKeepSrcElement(); ocopy.ignoreMissingFromData = scopy.isIgnoreMissingFromData(); ocopy.ignoreUninitializedFromVariable = scopy.isIgnoreUninitializedFromVariable(); ocopy.insertMissingToData = scopy.isInsertMissingToData(); ocopy.insertMissingToData = scopy.isInsertMissingToData(); ocopy.debugInfo = new DebugInfo(_context.getSourceLocation(), scopy.getLineNo(), source.getExtensibilityElements()); try { if (scopy.getTo() == null) throw new CompilationException(__cmsgs.errMissingToSpec().setSource(scopy)); Object[] toResultType = new Object[1]; ocopy.to = compileTo(scopy.getTo(), toResultType); if (scopy.getFrom() == null) throw new CompilationException(__cmsgs.errMissingFromSpec().setSource(scopy)); ocopy.from = compileFrom(scopy.getFrom(), toResultType[0]); verifyCopy(ocopy); oassign.copy.add(ocopy); } catch (CompilationException ce) { _context.recoveredFromError(scopy, ce); } } }
sOnMessage.getRoute()); if (sOnMessage.getActivity() == null) throw new CompilationException(__cmsgs.errEmptyOnMessage().setSource(sOnMessage)); oOnMessage.activity = _context.compile(sOnMessage.getActivity()); opick.onMessages.add(oOnMessage); oalarm.untilExpr = _context.compileExpr(onAlarmDef.getUntil()); } else { throw new CompilationException(__cmsgs.errForOrUntilMustBeGiven().setSource(onAlarmDef)); throw new CompilationException(__cmsgs.errOnAlarmWithCreateInstance().setSource(onAlarmDef));
_oprocess.allPartnerLinks.add(oplink); } catch (CompilationException ce) { ce.getCompilationMessage().setSource(plink); throw ce;
throw new CompilationException(__cmsgs.errUnknownToSpec().setSource(to)); } catch (CompilationException ce) { if (ce.getCompilationMessage().source == null)