public boolean error(Message message, Throwable throwable) { throw new JbpmException("Failed to send message", throwable); } })
if (!je.getMessage().contains("no behaviour on")) { throw je;
protected Enumeration<URL> getResources(String resourceName) { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Enumeration<URL> resourceUrls; try { resourceUrls = classLoader.getResources(resourceName); if (!resourceUrls.hasMoreElements()) { resourceUrls = BpmnParser.class.getClassLoader().getResources(resourceName); } } catch (Exception e) { throw new JbpmException("couldn't get resource urls for "+resourceName, e); } return resourceUrls; }
public boolean evaluate(OpenExecution execution) { ExecutionImpl executionImpl = (ExecutionImpl) execution; Object result = executionImpl.resolveExpression(expression, language); if (result instanceof Boolean) { return ((Boolean) result).booleanValue(); } else { throw new JbpmException("Expression '" + expression + "' did not resolve to a boolean value"); } }
public void perform(OpenExecution execution) { try { Expression.create(script, language).evaluate(execution); } catch (Exception e) { throw new JbpmException("couldn't run script: " + e.getMessage(), e); } }
protected void initializeProcessEngine() { try { InitialContext ctx = new InitialContext(); this.processEngine = (ProcessEngine) ctx.lookup("java:/ProcessEngine"); } catch (Exception e) { // Fall back to default mechanism this.processEngine = Configuration.getProcessEngine(); } this.webServiceHost = (String) processEngine.get("jbpm.console.server.host"); this.webServicePort = (String) processEngine.get("jbpm.console.server.port"); if ( (webServiceHost==null) || (webServicePort==null) ) { throw new JbpmException("make sure that strings 'jbpm.console.server.host' and 'jbpm.console.server.port' are properly configured in the process-engine-context of jbpm.cfg.xml"); } }
protected void initializeProcessEngine() { try { InitialContext ctx = new InitialContext(); this.processEngine = (ProcessEngine) ctx.lookup("java:/ProcessEngine"); } catch (Exception e) { // Fall back to default mechanism this.processEngine = Configuration.getProcessEngine(); } this.webServiceHost = (String) processEngine.get("jbpm.console.server.host"); this.webServicePort = (String) processEngine.get("jbpm.console.server.port"); if ( (webServiceHost==null) || (webServicePort==null) ) { throw new JbpmException("make sure that strings 'jbpm.console.server.host' and 'jbpm.console.server.port' are properly configured in the process-engine-context of jbpm.cfg.xml"); } }
if (!endpoint.equalsIgnoreCase(messageSource)) throw new JbpmException("Incoming message source is " + messageSource + " but expected source is " + endpoint); if (!payloadClass.isAssignableFrom(payload.getClass())) throw new JbpmException("Incoming message is of type " + payload.getClass() + " but expected type is " + payloadClass);
if (!endpoint.equalsIgnoreCase(messageSource)) throw new JbpmException("Incoming message source is " + messageSource + " but expected source is " + endpoint); if (!payloadClass.isAssignableFrom(payload.getClass())) throw new JbpmException("Incoming message is of type " + payload.getClass() + " but expected type is " + payloadClass);
public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) { ActivityImpl activity = execution.getActivity(); if (parameters!=null) { execution.setVariables(parameters); } List<Transition> outgoingTransitions = new ArrayList<Transition>(); if (signalName != null) { Transition transition = activity.findOutgoingTransition(signalName); if (transition == null) { throw new JbpmException("Cannot find an outgoing transition for " + activity.getName() + " named " + signalName); } outgoingTransitions.add(transition); execution.fire(signalName, activity); } else { outgoingTransitions.addAll(findOutgoingSequenceFlow(execution, CONDITIONS_CHECKED)); } proceed(execution, outgoingTransitions); } }
throw new JbpmException("No sequence flow condition evaluated to true for " + execution.getActivityName() + " and no default sequenceFlow was speficied"); throw new JbpmException("No outgoing sequence flow found for " + execution.getActivityName());
if (mule == null) throw new JbpmException("The Mule MessageService is not available from the ProcessEngine, you may need to add it to your jbpm.cfg.xml file"); if (!responsePayloadClass.isAssignableFrom(responsePayload.getClass())) throw new JbpmException("Response message is of type " + responsePayload.getClass() + " but expected type is " + responsePayloadClass);
if (mule == null) throw new JbpmException("The Mule MessageService is not available from the ProcessEngine, you may need to add it to your jbpm.cfg.xml file"); if (!responsePayloadClass.isAssignableFrom(responsePayload.getClass())) throw new JbpmException("Response message is of type " + responsePayload.getClass() + " but expected type is " + responsePayloadClass);
public void execute(ExecutionImpl execution) { List<Activity> startActivities = findStartActivities(execution); if (!startActivities.isEmpty()) { ExecutionImpl parent = execution.createScope(execution.getActivity()); for (Activity startActivity: startActivities) { parent.setState(Execution.STATE_INACTIVE_CONCURRENT_ROOT); ExecutionImpl concurrentExecution = parent.createExecution(); concurrentExecution.setState(Execution.STATE_ACTIVE_CONCURRENT); concurrentExecution.execute(startActivity); } } else { throw new JbpmException("Could not find start activity for the sub-process " + execution.getActivityName()); } }
throw new JbpmException("no target specified");