/** * Checks if the client is connected to the BPEL engine. * * @return true if the client is connected to the BPEL engine; false otherwise. */ protected synchronized boolean isConnected() { throw new WorkflowRuntimeException("Critical Error: Called a unsupported API"); }
/** * @see org.apache.airavata.xbaya.invoker.Invoker#invoke() */ public boolean invoke() throws WorkflowException { try { boolean success = this.operation.executeRequestResponseOperation(this.inputMessage, this.outputMessage, this.faultMessage); while(this.outputMessage == null){ } return success; } catch (RuntimeException e) { String message = "Error in invoking a service."; throw new WorkflowException(message, e); } }
@Override public void run() { try { Monitor.this.stop(); } catch (WorkflowException e) { // Ignore the error in unsubscription. logger.error(e.getMessage(), e); } } }.start();
/** * @see org.apache.airavata.workflow.model.graph.Graph#getID() */ public String getID() { if (this.id == null) { this.id = this.name; // If its still null if (null == this.id) { throw new WorkflowRuntimeException("The workflow ID is null"); } } return this.id; }
/** * @see org.apache.airavata.workflow.engine.invoker.Invoker#invoke() */ public boolean invoke() throws WorkflowException { try { boolean success = this.operation.executeRequestResponseOperation(this.inputMessage, this.outputMessage, this.faultMessage); while(this.outputMessage == null){ } return success; } catch (RuntimeException e) { String message = "Error in invoking a service."; throw new WorkflowException(message, e); } }
public URI getNameSpace() { try { return new URI(WorkflowConstants.LEAD_NS); } catch (URISyntaxException e) { throw new WorkflowRuntimeException(e); } }
public static Object getObjectOfType(int index, Object obj) { switch (index) { case 0: return new Integer((String) obj); case 1: return obj; } throw new WorkflowRuntimeException("type Not Supported yet!!"); }
/** * Adds an Edge. * * @param edge * The edge to add */ protected void addEdge(EdgeImpl edge) { if (this.edges.contains(edge)) { throw new WorkflowRuntimeException("The edge is already addes"); } else { this.edges.add(edge); } }
/** * Removes an Edge. * * @param edge * The edge to remove. */ protected void removeEdge(Edge edge) { if (this.edges.contains(edge)) { this.edges.remove(edge); // this.node.edgeWasRemoved(edge); } else { throw new WorkflowRuntimeException("The edge doesn't exist."); } }
/** * @param query */ private String extractDataType(String query) { int index = query.indexOf(':'); if (index == -1) { throw new WorkflowRuntimeException("Invalid query no : delimeter found " + query); } String[] split = query.substring(index + 1).trim().split("/"); if (split.length == 0) { throw new WorkflowRuntimeException("Unknown Xpath " + query.substring(index)); } return split[split.length - 1]; }
private String getOperationName(String code) { String[] publicSplit = code.split("public"); String searchStr = this.functionStr.substring(this.functionStr.indexOf("("), this.functionStr.indexOf(")")); int index = -1; for (int i = 0; i < publicSplit.length; ++i) { if (publicSplit[i].indexOf(searchStr) != -1) { index = i; break; } } if (index == -1) { throw new WorkflowRuntimeException("Operation name not found"); } return publicSplit[index].substring(0, publicSplit[index].indexOf(searchStr)).trim().split(" ")[1]; }
/** * Moves the node at the index up. * * @param index */ public void up(int index) { if (index < 1 || index >= this.parameterNodes.size()) { throw new WorkflowRuntimeException("Illegal index: " + index); } swap(index - 1, index); }
/** * Moves the node at the index up. * * @param index */ public void up(int index) { if (index < 1 || index >= this.parameterNodes.size()) { throw new WorkflowRuntimeException("Illegal index: " + index); } swap(index - 1, index); }
/** * Moves the node at the index down. * * @param index */ public void down(int index) { if (index < 0 || index >= this.parameterNodes.size() - 1) { throw new WorkflowRuntimeException("Illegal index: " + index); } swap(index, index + 1); }
/** * @see org.apache.airavata.workflow.model.graph.impl.PortImpl#getComponentPort() */ @Override public DynamicComponentPort getComponentPort() { if (this.componentPort == null) { ComponentPort port = super.getComponentPort(); if (port instanceof DynamicComponentPort) { this.componentPort = (DynamicComponentPort) port; } else { throw new WorkflowRuntimeException("UNEXPECTED ERROR: Unable to resolve Port"); } } return this.componentPort; }
public DataPort getInputPort(String id) { for (DataPort port : this.inputPorts) { if (port.getID().equals(id)) { return port; } } throw new WorkflowRuntimeException("Port with id not found :" + id); }
public DataPort getOutputPort(String fromPortID) { for (DataPort port : this.outputPorts) { if (port.getID().equals(fromPortID)) { return port; } } throw new WorkflowRuntimeException("Port with id not found :" + fromPortID); }
/** * This is used for ODE * * @return The Template ID like id */ public URI getUniqueWorkflowName() { try { return new URI(WorkflowConstants.LEAD_NS + "/" + this.getName()); } catch (URISyntaxException e) { throw new WorkflowRuntimeException(e); } }
/** * Moves the node at the index down. * * @param index */ public void down(int index) { if (index < 0 || index >= this.parameterNodes.size() - 1) { throw new WorkflowRuntimeException("Illegal index: " + index); } swap(index, index + 1); }
/** * */ private void notifyPause() { if (this.getWorkflow().getExecutionState() != WorkflowExecutionState.RUNNING && this.getWorkflow().getExecutionState() != WorkflowExecutionState.STEP) { throw new WorkflowRuntimeException("Cannot pause when not running"); } notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED, WorkflowExecutionState.PAUSED); }