public com.ebmwebsourcing.easyviper.core.api.engine.Scope getParentScope() throws com.ebmwebsourcing.easyviper.core.api.CoreException { com.ebmwebsourcing.easyviper.core.api.engine.Scope ret = service.getParentScope(); return ret; }
public com.ebmwebsourcing.easyviper.core.api.engine.Scope getParentScope() throws com.ebmwebsourcing.easyviper.core.api.CoreException { if ( impl == null ) { throw new java.lang.NullPointerException("Trying to invoke a method on a client or server interface whose complementary interface is not bound."); } com.ebmwebsourcing.easyviper.core.api.engine.Scope ret = impl.getParentScope(); return ret; }
@Override protected void executeOnInactive() throws CoreException { this.log.finest("start echo behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_STARTED; this.log.finest("execute echo behaviour: " + this.message); if(this.message != null) { System.out.println(this.message.evaluate(this.node.getExecution().getParentScope())); } }
private void whileExecution() throws CoreException { Boolean cond = (Boolean) this.condition.evaluate(this.getNode().getExecution() .getParentScope()); if (cond != null && cond == true) { final List<Node> childs = this.node.getChildNodes(); if ((childs != null) && (childs.size() > 0)) { getNode().getExecution().setNextExecutableElements(this, childs.get(0)); } } else { this.log.finest("end while behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_ENDED; } }
private void whileExecution() throws CoreException { Boolean cond = (Boolean) this.condition.evaluate(this.getNode().getExecution() .getParentScope()); if (cond != null && cond == true) { final List<Node> childs = this.node.getChildNodes(); if ((childs != null) && (childs.size() > 0)) { getNode().getExecution().setNextExecutableElements(this, childs.get(0)); } } else { this.log.finest("end while behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_ENDED; } }
private void repeatUntilExecution(boolean first) throws CoreException { boolean ok = true; if(!first) { Boolean cond = (Boolean) this.condition.evaluate(this.getNode().getExecution().getParentScope()); if (cond == null || cond == false) { this.log.finest("end repeat until behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_ENDED; ok = false; } } if(ok) { final List<Node> childs = this.node.getChildNodes(); if ((childs != null) && (childs.size() > 0)) { getNode().getExecution().setNextExecutableElements(this, childs.get(0)); } } }
@Override protected void executeOnInactive() throws CoreException { this.log.finest("start rethrow behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_STARTED; // find exception Exception e = null; Scope currentScope = this.getNode().getExecution().getParentScope(); while(e==null && currentScope != null) { e = currentScope.isFaultScope(); currentScope = currentScope.getParentScope(); } if(e == null) { throw new CoreException("Impossible to find exception to rethrow"); } this.log.finest("execute rethrow behaviour: " + e.getClass()); if(!(e instanceof CoreException)) { throw new CoreException(e); } else { throw (CoreException)e; } }
private void repeatUntilExecution(boolean first) throws CoreException { boolean ok = true; if(!first) { Boolean cond = (Boolean) this.condition.evaluate(this.getNode().getExecution().getParentScope()); if (cond == null || cond == false) { this.log.finest("end repeat until behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_ENDED; ok = false; } } if(ok) { final List<Node> childs = this.node.getChildNodes(); if ((childs != null) && (childs.size() > 0)) { getNode().getExecution().setNextExecutableElements(this, childs.get(0)); } } }
public InternalMessage<?> sendSyncTo(final InternalMessage<?> request, final Endpoint endpoint, final ExternalContext context) throws CoreException { final com.ebmwebsourcing.easyviper.core.api.engine.Process p = this .getNode().getExecution().getParentScope().getProcess(); return p.getEngine().sendSyncTo(request, endpoint, context); }
public void sendTo(final InternalMessage<?> message, final Endpoint endpoint, final ExternalContext context) throws CoreException { final com.ebmwebsourcing.easyviper.core.api.engine.Process p = this .getNode().getExecution().getParentScope().getProcess(); p.getEngine().sendTo(message, endpoint, context); }
@Override public InternalMessage<?> sendSyncTo(final InternalMessage<?> request, final Endpoint endpoint, final Map<Endpoint, Map<String, ExternalContext>> context) throws CoreException { final com.ebmwebsourcing.easyviper.core.api.engine.Process p = this .getNode().getExecution().getParentScope().getProcess(); return p.getEngine().sendSyncTo(request, endpoint, context); }
public synchronized void accept(final InternalMessage<?> internalMessage, final ExternalContext context) throws CoreException { if (this.internalMessageType == null) { throw new CoreException( "Configuration error: The type of internal message must be setted"); } this.checkModel(); // load the good instance Execution validExecution = this.acceptInternalMessage(internalMessage, context); if (validExecution == null) { this.log.finest("no process found => store the received message"); AutoFlushMessageServiceImpl autoflush = this.serviceManager.getService(AutoFlushMessageServiceImpl.class); autoflush.addMessagesInRegistry(internalMessage, context); } else { // set the context //TODO Check Reflexion on what is a context (implements equality ...) Endpoint endpoint = findEndpointFromMessage(internalMessage, validExecution.getParentScope().getProcess());//this.getProcessInstanceRegistry()); if(validExecution.getParentScope().getProcess().getExternalContext(endpoint, internalMessage.getOperationName()) == null){ this.log.finest("set the context: " + context + " into process instance " + validExecution.getParentScope().getProcess().getName()); validExecution.getParentScope().getProcess().addExternalContext(endpoint, internalMessage.getOperationName(), context); } // restart threads for all necessary executions. restartExecutionAndParents(validExecution,context); } }
public void sendTo(final InternalMessage<?> message, final Endpoint endpoint, final Map<Endpoint, Map<String, ExternalContext>> context) throws CoreException { final com.ebmwebsourcing.easyviper.core.api.engine.Process p = this .getNode().getExecution().getParentScope().getProcess(); p.getEngine().sendTo(message, endpoint, context); }
@Override protected void executeOnInactive() throws CoreException { this.log.finest("start rethrow behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_STARTED; // find exception Exception e = null; Scope currentScope = this.getNode().getExecution().getParentScope(); while(e==null && currentScope != null) { e = currentScope.isFaultScope(); currentScope = currentScope.getParentScope(); } if(e == null) { throw new CoreException("Impossible to find exception to rethrow"); } this.log.finest("execute rethrow behaviour: " + e.getClass()); if(!(e instanceof CoreException)) { throw new CoreException(e); } else { throw (CoreException)e; } }
@Override protected void executeOnInactive() throws CoreException { this.state = State.ACTIVITY_STARTED; alreadyNotified = false; if(triggeringNodes==null || triggeringNodes.isEmpty()) { this.state = State.ACTIVITY_ENDED; return; } try{ SCAHelper.getSCAHelper().startComponentAndSubComponents(getNode().getExecution().getParentScope().getComponent()); } catch(SCAException e) { throw new CoreException(e); } List<Node> nodes = new ArrayList<Node>(); for(Node child : getNode().getChildNodes()) { for(Node triggeringNode : triggeringNodes) { if(triggeringNode.getName().equals(child.getName())) { nodes.add(child); break; } } } getNode().getExecution().setNextExecutableElements(this, nodes); }
public void affect() throws CoreException { if (this.assignements != null) { for (final AssignementExpression assignement : this.assignements) { if ((assignement == null) || (assignement.getLeft() == null)) { throw new CoreException("The left assignement is null"); } Assigner assigner = getNode().getExecution().getParentScope().getProcess().getAssigner(); if (assigner == null) { throw new CoreException( "Error: the assigner cannot be null"); } // realized affectation this.log.finest("set " + assignement.getRight() + " in " + assignement.getLeft()); assigner.affect( this.getNode().getExecution().getParentScope(), assignement.getLeft(), assignement.getRight()); } } }
public Map<String, Execution> getSuspendedExecutions() throws CoreException { Map<String, Execution> res = new HashMap<String,Execution>(); if (this.getParentExecution() != null && this.getParentExecution().getState().equals(Execution.State.SUSPENDED)) { res.putAll(getSuspendedExecutions(this.getParentExecution().getParentScope())); } else if (this.getParentExecution() == null) { final Execution main = this.createParentExecution(); final Component exec = FractalHelper.getFractalHelper() .getComponentByInterface(this.getComponent(), (Interface) main, "service"); FractalHelper.getFractalHelper().startComponent(exec); try { if(!res.containsKey(this.getParentExecution().getName())) { res.put(this.getParentExecution().getName(), this.getParentExecution()); } } catch (CoreException e) { // do nothing } } return res; }
public void affect() throws CoreException { if (this.assignements != null) { for (final AssignementExpression assignement : this.assignements) { if ((assignement == null) || (assignement.getLeft() == null)) { throw new CoreException("The left assignement is null"); } Assigner assigner = getNode().getExecution().getParentScope().getProcess().getAssigner(); if (assigner == null) { throw new CoreException( "Error: the assigner cannot be null"); } // realized affectation this.log.finest("set " + assignement.getRight() + " in " + assignement.getLeft()); assigner.affect( this.getNode().getExecution().getParentScope(), assignement.getLeft(), assignement.getRight()); } } }
@Override protected void executeOnInactive() throws CoreException { this.log.finest("start breakpoint behaviour on node: " + this.node.getName()); this.state = State.ACTIVITY_STARTED; DebugBehaviour debug = DebugUtil.findDebugBehaviour(this.getNode().getExecution().getParentScope().getProcess()); if (debug != null) { this.log.finest("is debug mode? " + debug.isActivate()); } else { this.log.finest("is debug mode? false - no debug behaviour found"); } if (debug != null && debug.isActivate()) { this.getNode().getExecution().setState( Execution.State.SUSPENDED); this.log.finest("breakpoint behaviour: suspend the execution " + this.getNode().getExecution().getName() + " => " + this.getNode().getExecution().getState()); this.getNode().selectDefaultNextTarget(); } }
@Override protected void executeOnInactive() throws CoreException { String msg = this.getMessage().evaluate(this.node.getExecution().getParentScope()); if(this.level == null){ severe("Level is null !" + msg); }else if(this.level.equals(LoggerBehaviour.LEVEL.SEVERE)){ severe(msg); }else if(this.level.equals(LoggerBehaviour.LEVEL.WARNING)){ warning(msg); }else if(this.level.equals(LoggerBehaviour.LEVEL.INFO)){ info(msg); }else if(this.level.equals(LoggerBehaviour.LEVEL.DEBUG)){ debug(msg); } }