public com.ebmwebsourcing.easyviper.core.api.engine.Node createNode(final java.lang.String arg0,final java.lang.Class<? extends com.ebmwebsourcing.easyviper.core.api.engine.behaviour.Behaviour> arg1,final java.util.Map<java.lang.String,java.lang.Object> arg2) throws com.ebmwebsourcing.easyviper.core.api.CoreException { com.ebmwebsourcing.easyviper.core.api.engine.Node ret = service.createNode(arg0,arg1,arg2); return ret; }
public com.ebmwebsourcing.easyviper.core.api.engine.variable.Variable findVariable(final javax.xml.namespace.QName arg0) throws com.ebmwebsourcing.easyviper.core.api.CoreException { com.ebmwebsourcing.easyviper.core.api.engine.variable.Variable ret = service.findVariable(arg0); return ret; }
public com.ebmwebsourcing.easyviper.core.api.engine.Process getProcess() throws com.ebmwebsourcing.easyviper.core.api.CoreException { com.ebmwebsourcing.easyviper.core.api.engine.Process ret = service.getProcess(); return ret; }
@SuppressWarnings("unchecked") private void cleanVariables(Scope scope) throws CoreException { ScopeImpl.log.finest("Clean all variables of scope: " + scope.getName()); for(Variable var: scope.getVariables().values()) { var.setValue(null); } }
public Node createForkPattern(final String name, final List<Node> childNodes, final Scope scope) throws CoreException { Node parentNode = null; if (scope == null) { throw new CoreException("scope cannot be null"); } parentNode = scope.createNode(name, ForkBehaviourImpl.class, null); // link all children to parent if (childNodes != null) { for (final Node children : childNodes) { scope.linkedChildNodeToParent(parentNode, children); } } return parentNode; }
public Node createForkPattern(final String name, final List<Node> childNodes, final Scope scope) throws CoreException { Node parentNode = null; if (scope == null) { throw new CoreException("scope cannot be null"); } parentNode = scope.createNode(name, new ForkBehaviourImpl()); // link all children to parent if (childNodes != null) { for (final Node children : childNodes) { scope.linked(parentNode, children); } } return parentNode; } }
Scope scope = (Scope) this.getNode().getComponent().getFcInterface("scope"); Component execComp = FractalHelper.getFractalHelper().getFirstComponentByName(scope.getComponent(), "exec_in_" + scope.getName()); Execution exec = null; if(execComp == null) { exec = scope.createExecution("exec_in_" + scope.getName()); execComp = FractalHelper.getFractalHelper().getComponentByInterface(this.getNode().getComponent(), (Interface) exec, "service"); } else { execComp); scope.setParentExecution(execComp); if(scope.getInitialNode() != null) { scope.linkInitialNodeAndExecution(); this.log.finest("this.getNode().getParentNode() = " + this.getNode().getParentNode()); this.log.finest("scope.getParentNode() = " + scope.getParentNode()); if(scope.getParentScope() != null) { scope.getParentScope().unlinkedNodeAndExecution(scope, exec); scope.end(false);
.getFractalHelper() .getComponentByInterface( this.execution.getParentScope().getComponent(), (org.objectweb.fractal.api.Interface) this.behaviour, "service"); if(faultScope == null || faultScope.isFaultScope() != null) { } else { log.finest("fault catched by scope: " + faultScope.getName()); faultScope.setFaultScope(e); if(faultScope.getParentScope().getName().equals(this.execution.getParentScope().getName())) { getExecution().setNextExecutableElements(this, (Node)faultScope.getComponent(). getFcInterface("service")); faultScope.getParentScope().linkedExecution2ExecutableElement(faultScope.getParentScope().getExecution(), faultScope); faultScope.getParentScope().linkedExecutableElement2Execution(faultScope, faultScope.getParentScope().getExecution()); faultScope.execute();
Scope scope = (Scope) this.getNode().getComponent().getFcInterface("service"); if (!SCAHelper.getSCAHelper().isStarted(scope.getExecution().getComponent())) { SCAHelper.getSCAHelper().startComponent(scope.getExecution().getComponent()); Component execComp = SCAHelper.getSCAHelper().getFirstComponentByName(scope.getComponent(), "exec_in_" + scope.getName()); Execution exec = null; if(execComp == null) { exec = scope.createExecution("exec_in_" + scope.getName()); execComp = SCAHelper.getSCAHelper().getComponentByInterface(this.getNode().getComponent(), (Interface) exec, "service"); } else { SCAHelper.getSCAHelper().startComponent(execComp); scope.setParentExecution(execComp); exec.setParentExecution(scope.getExecution()); if(scope.getInitialNode() != null) { scope.linkInitialNodeAndExecution(); this.log.finest("run the execution in scope " + scope.getName()); exec.run(); this.log.finest("scope.getParentNode() = " + scope.getParentNode()); Scope parentScope = scope.getParentScope(); if( parentScope != null ) {
final BPELVariable varFrom = (BPELVariable) scope.findVariable(this.variableToCorrelate); if(varFrom == null) { throw new CoreException("Impossible to find variable corresponding to this name " + this.variableToCorrelate); this.log.finest("get specific correlations"); for(final Correlation corr: this.correlations) { correlationGroups.addAll(scope.findCorrelationGroups(corr.getSet())); this.log.finest("get global correlations on the scope: " + scope.getName()); correlationGroups = scope.getProcess().getCorrelationGroups(); final To to = (To) corr.getOriginator(); final Variable varTo = scope.findVariable(new QName(to.getVariableProperty().getVariable())); if(varTo == null) { throw new CoreException("Impossible to find variable corresponding to this name " + to.getVariableProperty().getVariable());
protected void cleanScopes(Scope scope) throws CoreException { for(Scope faultScope: scope.getExceptions().values()) { cleanScopes(faultScope); scope.setFaultScope(null); if (scope.getParentExecution() != null) { scope.getParentExecution().removeChildExecutions(); final Component exeComp = FractalHelper.getFractalHelper() .getComponentByInterface( scope.getComponent(), (org.objectweb.fractal.api.Interface) scope .getParentExecution(), "service"); if (exeComp != null) { FractalHelper.getFractalHelper().deleteComponent(exeComp); scope.setParentExecution(null); List<Component> components = FractalHelper.getFractalHelper().getComponents(scope.getComponent()); for(Component component: components) { if(FractalHelper.getFractalHelper().isStarted(component)) {
final Variable inputVariable = scope.findVariable(this.inputVariableName); .findEndpoint(this.providerEndpointKey); .getNode().getExecution().getParentScope().getProcess() .getExternalContext()); } else if (this.kind == Kind.SYNCHRONOUS) { this.log.finest("synchronous send"); final Variable outputVariable = scope .findVariable(this.outputVariableName);
final Endpoint providerEndpoint = scope.findEndpoint(partner); invokeNode = scopeComp.createNode(invoke.getName(), send); scope.getEndpoints().put(partner, providerEndpoint); scopeComp.setInitialNode(invokeNode);
Component comp = SCAHelper.getSCAHelper().getFirstComponentByName(scopetemp.getComponent(), "exec_in_" + scopetemp.getName()); for(Entry<Fault, Scope> ex : scopetemp.getExceptions().entrySet()){ ex.getValue().setFaultScope(null);
public void setStateRecursively(final State state) { // TODO : in the case we set recursively SUSPENDED state, // there is a chance that a parent execution becomes SUSPENDED // whereas some child execution are still ACTIVE. // Instead of that, we should mark a parent execution as SUSPENDED // if and only if all child executions are ENDED or SUSPENDED. this.setState(state); try { if (!this.getParentScope().getName().equals( this.getParentScope().getProcess().getName())) { Execution parentScopeExecution = this.getParentScope().getExecution(); parentScopeExecution.setStateRecursively(state); } else if (getParentExecution() != null) { getParentExecution().setStateRecursively(state); } } catch (CoreException e) { log.severe("error: " + e.getMessage()); // do nothing } }
faultVar = (BPELVariable) parentScope.findVariable(new QName( catch_.getFaultVariable())); parentScope.getExceptions().put(fault, catchScopeComp); catchScopeComp.setInitialNode(activityNode); fault.setFaultName(new QName("unknown")); fault.setFaultHandler(new BPELFaultHandler(bpelprocess, null)); parentScope.getExceptions().put(fault, catchScopeComp); catchScopeComp.setInitialNode(activityNode);
topScope.getVariables().put(v.getQName(), v); topScope.setInitialNode(assignINode); final Transition t = topScope.createTransition("AssignI" + "2" + forEach_.getName(), null); topScope.linked(assignINode, t, forEachNode);
private Scope findFaultScope(Scope currentScope, Exception e) throws CoreException { Scope faultScope = null; // test if currentScope is not already a fault scope Exception exTest = null; Scope current = currentScope; while(exTest==null && current != null) { exTest = current.isFaultScope(); current = current.getParentScope(); } if(exTest == null) { for(Entry<Fault, Scope> entry: currentScope.getExceptions().entrySet()) { if(entry.getKey().getFaultHandler() != null && entry.getKey().getFaultHandler().match(currentScope, entry.getKey(), e, entry.getValue())) { faultScope = entry.getValue(); break; } } if(faultScope == null && currentScope.getParentScope() != null) { faultScope = this.findFaultScope(currentScope.getParentScope(), e); } } return faultScope; }
@Override protected void executeOnStarted() throws CoreException { try{ Scope scope = (Scope) this.getNode().getComponent().getFcInterface("service"); Component execComp = SCAHelper.getSCAHelper().getFirstComponentByName(scope.getComponent(), "exec_in_" + scope.getName()); if (!SCAHelper.getSCAHelper().isStarted(execComp)) { SCAHelper.getSCAHelper().startComponent(execComp); } Execution exec = (Execution) execComp.getFcInterface("service"); if(exec.getState()!=Execution.State.ENDED) return; this.state = State.ACTIVITY_ENDED; scope.end(false); this.log.finest("end scope behaviour on node: " + this.node.getName()); } catch (NoSuchInterfaceException e) { throw new CoreException(e); } catch (SCAException e) { throw new CoreException(e); } }
public java.util.Map<javax.xml.namespace.QName,com.ebmwebsourcing.easyviper.core.api.engine.variable.Variable> getVariables() { java.util.Map<javax.xml.namespace.QName,com.ebmwebsourcing.easyviper.core.api.engine.variable.Variable> ret = service.getVariables(); return ret; }