@Override public String getName() { throw new BonitaRuntimeException("Call getName method on XPDLProcess is not allowed! We must always use ids!"); } }
public SerializedCommand(final Command<?> command) { super(); try { this.className = command.getClass().getName(); this.serializedCommand = Misc.serialize(command); } catch (final IOException e) { throw new BonitaRuntimeException(e); } catch (final ClassNotFoundException e) { throw new BonitaRuntimeException(e); } }
public SerializedCommand(final Command<?> command) { super(); try { this.className = command.getClass().getName(); this.serializedCommand = Misc.serialize(command); } catch (final IOException e) { throw new BonitaRuntimeException(e); } catch (final ClassNotFoundException e) { throw new BonitaRuntimeException(e); } }
@Override public void addAttachment(final ProcessInstanceUUID instanceUUID, final String name, final String fileName, final byte[] value) { if (value == null && fileName != null) { throw new BonitaRuntimeException("The content of the attachment cannot be null"); } createDocumentOrVersion(instanceUUID, name, fileName, value, DocumentService.DEFAULT_MIME_TYPE); }
@Override public Set<String> getKeys() { final Set<String> keys = new HashSet<String>(); try { analysePath(this.base, keys); } catch (final Exception e) { throw new BonitaRuntimeException(e); } return keys; }
public static String getEvaluatedCorrelationKey(final ProcessDefinitionUUID definitionUUID, final String correlationKeyName, final String correlationKeyExpression) { if (correlationKeyExpression != null) { try { final String expression = GroovyUtil.evaluate(correlationKeyExpression, null, definitionUUID, false).toString(); return correlationKeyName.concat("||||").concat(expression); } catch (final GroovyException e) { throw new BonitaRuntimeException(e); } } return null; }
public boolean evaluate(final EventListenerExecution xpdlExecution) { if ("bsh".equals(this.scriptType)) { return this.evaluateBsh(xpdlExecution); } throw new BonitaRuntimeException("Unsupported scriptType: " + this.scriptType); }
public static Map<String, byte[]> getJarEntries(final String jarFile, final byte[] jar) { JarInputStream jis = null; try { jis = new JarInputStream(new ByteArrayInputStream(jar)); return getJarEntries(jis, jarFile); } catch (final IOException e) { throw new BonitaRuntimeException("Unable to load jar entries from jar file: " + jarFile, e); } finally { Misc.close(jis); } }
/** @see Execution#unlock() */ public void unlock() { if (STATE_ACTIVE.equals(state)) { final String message = ExceptionManager.getInstance().getFullMessage("bp_EI_23"); throw new BonitaRuntimeException(message); } if (LOG.isLoggable(Level.FINE)) { LOG.fine("unlocking " + this); } state = STATE_ACTIVE; }
private static <T> T getEnvClass(final Class<T> clazz) { final Environment environment = getEnv(); final T object = environment.get(clazz); if (object == null) { throw new BonitaRuntimeException("No object of class " + clazz.getName() + " found in environment!"); } return object; }
public WebAPI getWebAPI(final String queryList) { try { return AccessorProxyUtil.getRemoteClientAPI(WebAPI.class, Misc.lookup(AccessorUtil.WEBAPI_JNDINAME, jndiEnvironment), queryList); } catch (final NamingException e) { throw new BonitaRuntimeException(e); } }
public Listener addListener(Listener listener, String eventName) { if (eventName == null) { String message = ExceptionManager.getInstance().getFullMessage("bp_DO_3"); throw new BonitaRuntimeException(message); } List<String> eventNames = new ArrayList<String>(); eventNames.add(eventName); return addListener(listener, eventNames); }
public void close() { if (LOG.isLoggable(Level.FINE)) { LOG.fine("closing " + this); } Environment popped = Environment.popEnvironment(); if (this != popped) { String message = ExceptionManager.getInstance().getFullMessage("bp_BE_1"); throw new BonitaRuntimeException(message); } }
public QueryRuntimeAPI getQueryRuntimeAPI(final String queryList) { try { return AccessorProxyUtil.getRemoteClientAPI(QueryRuntimeAPI.class, Misc.lookup(AccessorUtil.QUERYRUNTIME_JNDINAME, jndiEnvironment), queryList); } catch (final NamingException e) { throw new BonitaRuntimeException(e); } }
protected <T extends Enum<T>> T getEnumValue(final Class<T> enumType, final String valueAsString, final T defaultValue) { if (valueAsString == null) { return defaultValue; } try { return Misc.stringToEnum(enumType, valueAsString); } catch (final IllegalArgumentException e) { final String message = ExceptionManager.getInstance().getMessage("bpx_MEB_5", valueAsString, enumType.getName()); throw new BonitaRuntimeException(message, e); } }
protected <T extends Enum<T> > T getEnumValue(Class< T > enumType, String valueAsString, T defaultValue) { if (valueAsString == null) { return defaultValue; } try { return Misc.stringToEnum(enumType, valueAsString); } catch (IllegalArgumentException e) { String message = ExceptionManager.getInstance().getMessage( "bpx_EB_1", valueAsString, enumType.getName()); throw new BonitaRuntimeException(message, e); } }
private Object getClassInstance(final Class<?> clazz) { final Object obj = ReflectUtil.newInstance(clazz); if (obj == null) { final String message = ExceptionManager.getInstance().getFullMessage("be_CDL_2", clazz.getName()); throw new BonitaRuntimeException(message); } return obj; }
public CommandAPI getCommandAPI(final String queryList) { CommandAPI ejbCommandAPI; try { ejbCommandAPI = AccessorProxyUtil.getRemoteClientAPI(CommandAPI.class, Misc.lookup(AccessorUtil.COMMANDAPI_JNDINAME, jndiEnvironment), queryList); } catch (final NamingException e) { throw new BonitaRuntimeException(e); } return new EJBCommandAPIInterceptor(ejbCommandAPI); }
public void beginWithOneStartNode() { setIterationId(INITIAL_ITERATION_ID); if (!STATE_CREATED.equals(state)) { final String message = ExceptionManager.getInstance().getFullMessage("bp_EI_1 ", toString(), state); throw new BonitaRuntimeException(message); } state = STATE_ACTIVE; if (node != null) { performAtomicOperation(new ExecuteNode()); } }
@Override public byte[] getAttachmentValue(final AttachmentInstance attachmentInstance) { final DocumentationManager manager = EnvTool.getDocumentationManager(); try { final org.ow2.bonita.services.Document document = manager.getDocument(attachmentInstance.getUUID().getValue()); return manager.getContent(document); } catch (final DocumentNotFoundException e) { throw new BonitaRuntimeException(e); } }