private Object getStandaloneAPI(String className) { try { APIAccessor apiAccessor = new StandardAPIAccessorImpl(); Method m = apiAccessor.getClass().getMethod("get" + className); return m.invoke(apiAccessor); } catch (Exception e) { throw new BonitaRuntimeException("Cannot get the standalone api class", e); } }
protected void putAPI(final String queryList) { apis.put(queryList, new StandardAPIAccessorImpl().getCommandAPI(queryList)); }
protected ManagementAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); AccessorUtil.setContext(Context.Standard); if (managementAPI == null) { managementAPI = new StandardAPIAccessorImpl().getManagementAPI(); } return managementAPI; }
protected void putAPI(final String queryList) { apis.put(queryList, new StandardAPIAccessorImpl().getRuntimeAPI(queryList)); }
protected void putAPI(final String queryList) { apis.put(queryList, new StandardAPIAccessorImpl().getQueryRuntimeAPI(queryList)); }
final StandardAPIAccessorImpl accessor = new StandardAPIAccessorImpl(); final RuntimeAPI runtime = accessor.getRuntimeAPI(); for (final Entry<String, Object[]> output : outputs.entrySet()) { final String expression = (String) output.getValue()[0]; dataTypeClassName = getDataTypeClassName(variableName, instanceUUID, activityInstanceUUID); } catch (final BonitaRuntimeException e) { final ProcessDefinition process = accessor.getQueryDefinitionAPI().getProcess( instanceUUID.getProcessDefinitionUUID()); if (ProcessType.EVENT_SUB_PROCESS == process.getType()) { final QueryRuntimeAPI queryRuntimeAPI = accessor.getQueryRuntimeAPI(); final LightProcessInstance processInstance = queryRuntimeAPI.getLightProcessInstance(instanceUUID); dataTypeClassName = getDataTypeClassName(variableName, processInstance.getParentInstanceUUID(), null);
final Recorder recorder = EnvTool.getRecorder(); final ProcessInstanceUUID childInstanceUUID = (ProcessInstanceUUID) signalParameters.get("childInstanceUUID"); final StandardAPIAccessorImpl accessor = new StandardAPIAccessorImpl(); final QueryRuntimeAPI queryRuntimeAPI = accessor.getQueryRuntimeAPI(AccessorUtil.QUERYLIST_JOURNAL_KEY); Map<String, Object> childInstanceVariables = null; try { final AttachmentInstance childAttachment = queryRuntimeAPI.getLastAttachment(childInstanceUUID, source); final byte[] childAttachmentValue = queryRuntimeAPI.getAttachmentValue(childAttachment); accessor.getRuntimeAPI().addAttachment(instanceUUID, destination, childAttachment.getLabel(), childAttachment.getDescription(), childAttachment.getFileName(), childAttachment.getMetaData(), childAttachmentValue); } else { recorder.recordInstanceVariableUpdated(destination, variableValue, instanceUUID, EnvTool.getUserId());
protected QueryDefinitionAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); // We set the Context of the AccessorUtil to Standard // since we are in the engine core! // Therefore, hooks get executed properly when they call // AccessorUtil.getWhateverAccessor(); // Note that the Context in the APIInterceptor remains unchanged // (hence we have two contexts). The one in the APIInterceptor is used // to fetch the caller id. Note that in the case of EJB2 (this case), // the caller id has been set manually (see previous instruction). AccessorUtil.setContext(Context.Standard); if (queryDefinitionAPI == null) { queryDefinitionAPI = new StandardAPIAccessorImpl().getQueryDefinitionAPI(); } return queryDefinitionAPI; }
protected WebAPI getAPI(final Map<String, String> options) { if (options == null) { throw new IllegalArgumentException("The options are null or not well set."); } final String queryList = options.get(APIAccessor.QUERYLIST_OPTION); final String user = options.get(APIAccessor.USER_OPTION); final String domain = options.get(APIAccessor.DOMAIN_OPTION); UserOwner.setUser(user); DomainOwner.setDomain(domain); final String restUser = options.get(APIAccessor.REST_USER_OPTION); if (restUser != null) { RESTUserOwner.setUser(restUser); final String restPswd = options.get(APIAccessor.PASSWORD_HASH_OPTION); PasswordOwner.setPassword(restPswd); } if (!apis.containsKey(queryList)) { apis.put(queryList, new StandardAPIAccessorImpl().getWebAPI(queryList)); } return apis.get(queryList); }
protected IdentityAPI getAPI(final Map<String, String> options) { if (options == null) { throw new IllegalArgumentException("The options are null or not well set."); } final String queryList = options.get(APIAccessor.QUERYLIST_OPTION); final String user = options.get(APIAccessor.USER_OPTION); final String domain = options.get(APIAccessor.DOMAIN_OPTION); UserOwner.setUser(user); DomainOwner.setDomain(domain); final String restUser = options.get(APIAccessor.REST_USER_OPTION); if (restUser != null) { RESTUserOwner.setUser(restUser); final String restPswd = options.get(APIAccessor.PASSWORD_HASH_OPTION); PasswordOwner.setPassword(restPswd); } if (!apis.containsKey(queryList)) { apis.put(queryList, new StandardAPIAccessorImpl().getIdentityAPI(queryList)); } return apis.get(queryList); }
protected RepairAPI getAPI(final Map<String, String> options) { if (options == null) { throw new IllegalArgumentException("The options are null or not well set."); } final String queryList = options.get(APIAccessor.QUERYLIST_OPTION); final String user = options.get(APIAccessor.USER_OPTION); final String domain = options.get(APIAccessor.DOMAIN_OPTION); UserOwner.setUser(user); DomainOwner.setDomain(domain); final String restUser = options.get(APIAccessor.REST_USER_OPTION); if (restUser != null) { RESTUserOwner.setUser(restUser); final String restPswd = options.get(APIAccessor.PASSWORD_HASH_OPTION); PasswordOwner.setPassword(restPswd); } if (!apis.containsKey(queryList)) { apis.put(queryList, new StandardAPIAccessorImpl().getRepairAPI(queryList)); } return apis.get(queryList); }
protected DefinitionAPI getAPI() { Authentication.setUserId(ctx.getCallerPrincipal().getName()); AccessorUtil.setContext(Context.Standard); if (definitionAPI == null) { definitionAPI = new StandardAPIAccessorImpl().getDefinitionAPI(); } return definitionAPI; } public void ejbCreate() {
protected BAMAPI getAPI(final Map<String, String> options) { if (options == null) { throw new IllegalArgumentException("The options are null or not well set."); } final String queryList = options.get(APIAccessor.QUERYLIST_OPTION); final String user = options.get(APIAccessor.USER_OPTION); final String domain = options.get(APIAccessor.DOMAIN_OPTION); UserOwner.setUser(user); DomainOwner.setDomain(domain); final String restUser = options.get(APIAccessor.REST_USER_OPTION); if (restUser != null) { RESTUserOwner.setUser(restUser); final String restPswd = options.get(APIAccessor.PASSWORD_HASH_OPTION); PasswordOwner.setPassword(restPswd); } if (!apis.containsKey(queryList)) { apis.put(queryList, new StandardAPIAccessorImpl().getBAMAPI(queryList)); } return apis.get(queryList); }
public RuntimeAPI getRuntimeAPI() { return getRuntimeAPI(AccessorUtil.QUERYLIST_DEFAULT_KEY); }
public ManagementAPI getManagementAPI() { return getManagementAPI(AccessorUtil.QUERYLIST_DEFAULT_KEY); }
public CommandAPI getCommandAPI() { return getCommandAPI(AccessorUtil.QUERYLIST_DEFAULT_KEY); }
public IdentityAPI getIdentityAPI() { return getIdentityAPI(AccessorUtil.QUERYLIST_DEFAULT_KEY); }
public WebAPI getWebAPI() { return getWebAPI(AccessorUtil.QUERYLIST_DEFAULT_KEY); }
public RepairAPI getRepairAPI() { return getRepairAPI(AccessorUtil.QUERYLIST_DEFAULT_KEY); }
protected void putAPI(String queryList) { RuntimeAPI runtimeAPI = new StandardAPIAccessorImpl().getRuntimeAPI(queryList); // add REST interceptor final RESTServerAPIInterceptor restInterceptor = new RESTServerAPIInterceptor(runtimeAPI); Class<RuntimeAPI> clazz = RuntimeAPI.class; runtimeAPI = clazz.cast(Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { clazz }, restInterceptor)); apis.put(queryList, runtimeAPI); }