/** * To get the APIAccessor interface. * * @return the interface APIAccessor. */ public static APIAccessor getAPIAccessor() { return getAPIAccessor(null); }
/** * To get the QueryAPIAccessor interface. * * @return the interface QueryAPIAccessor. */ public static QueryAPIAccessor getQueryAPIAccessor() { return getQueryAPIAccessor(null); }
public static Context resetContext() { Context context = null; try { context = getContextFromClasspath(); } catch (final IOException ioe) { throw new BonitaRuntimeException(ioe); } if (context == null) { context = getContextFromSystem(); if (context == null) { context = discoverContext(); } } CONTEXT.set(context); return context; }
if (hookInstance instanceof Hook) { Hook hook = (Hook) hookInstance; hook.execute(AccessorUtil.getQueryAPIAccessor(), activityInst); } else if (hookInstance instanceof TxHook) { TxHook txHook = (TxHook) hookInstance; txHook.execute(AccessorUtil.getAPIAccessor(), activityInst); } else { throw new BonitaRuntimeException("Specified class is not a valid hook. It does not implement "
@Override protected Context initialValue() { return resetContext(); }
final ManagementAPI managementAPI = AccessorUtil.getManagementAPI(); if (managementAPI.checkUserCredentials(name, password)) { this.id = name;
@Override protected Context initialValue() { final Context context = AccessorUtil.findContext(); if (AccessorUtil.LOG.isLoggable(Level.INFO)) { AccessorUtil.LOG.info("Using: " + context + " as the api-type."); } return context; } };
static Context findContext() { String apiType = System.getProperty(AccessorUtil.API_TYPE_PROPERTY); if (apiType == null) { if (AccessorUtil.LOG.isLoggable(Level.INFO)) { AccessorUtil.LOG.info("Property: " + AccessorUtil.API_TYPE_PROPERTY + " has not been specified for api-type." + " Possible values are: " + Arrays.asList(Context.values()) + ". Using default value: " + Context.AutoDetect); } apiType = Context.AutoDetect.toString(); } final Context result = Misc.stringToEnum(Context.class, apiType); if (!result.equals(Context.AutoDetect)) { if (AccessorUtil.LOG.isLoggable(Level.INFO)) { AccessorUtil.LOG.info("API-Type: " + result + " has been specified through property: " + AccessorUtil.API_TYPE_PROPERTY); } return result; } return AccessorUtil.autoDetectContext(); }
@Override protected Context initialValue() { return resetContext(); }
final ManagementAPI managementAPI = AccessorUtil.getManagementAPI(); if (managementAPI.checkUserCredentials(name, password)) { this.id = name;
/** * To get the APIAccessor interface. * * @return the interface APIAccessor. */ public static APIAccessor getAPIAccessor() { return getAPIAccessor(null); }
public static Context resetContext() { Context context = null; try { context = getContextFromClasspath(); } catch (final IOException ioe) { throw new BonitaRuntimeException(ioe); } if (context == null) { context = getContextFromSystem(); if (context == null) { context = discoverContext(); } } CONTEXT.set(context); return context; }
/** * To get the QueryAPIAccessor interface. * * @return the interface QueryAPIAccessor. */ public static QueryAPIAccessor getQueryAPIAccessor() { return getQueryAPIAccessor(null); }
/** * To get the QueryDefinitionAPI interface. * * @return the interface QueryDefinitionAPI. */ public static QueryDefinitionAPI getQueryDefinitionAPI() { return getAPIAccessor().getQueryDefinitionAPI(); }
protected void mapRole(Performer performer) { ClassInfo rolemapperInfo = performer.getRoleMapper(); if (rolemapperInfo != null) { RoleMapper roleMapper = ClassDataLoader.getRoleMapperInstance(packageUUID, rolemapperInfo); try { this.candidates = roleMapper.searchMembers( AccessorUtil.getQueryAPIAccessor(), instanceUUID, performer.getParticipantId()); } catch (Exception e) { throw new BonitaWrapperException( new RoleMapperInvocationException(rolemapperInfo.toString(), e) ); } } }
/** * To get the CommandAPI interface. * * @return the interface CommandAPI. */ public static CommandAPI getCommandAPI() { return getAPIAccessor().getCommandAPI(); }
protected void assign(Performer performer) { ClassInfo performerAssignInfo = performer.getPerformerAssign(); if (performerAssignInfo != null) { PerformerAssign performerAssign = ClassDataLoader.getPerformerAssignInstance(packageUUID, performerAssignInfo); ActivityInstance<ActivityBody> activityInst = EnvTool.getJournalQueriers().getActivityInstance(instanceUUID, activityId, iterationId, activityInstanceId); try { this.userId = performerAssign.selectUser(AccessorUtil.getQueryAPIAccessor(), activityInst, this.candidates); } catch (Exception e) { throw new BonitaWrapperException( new PerformerAssignInvocationException(performerAssignInfo.toString(), e) ); } } }
/** * To get the RuntimeAPI interface. * * @return the interface RuntimeAPI. */ public static RuntimeAPI getRuntimeAPI() { return getAPIAccessor().getRuntimeAPI(); }
try { actInstDescr = actInstantiator.execute( AccessorUtil.getQueryAPIAccessor(), instanceUUID, activityId, xpdlExecution.getIterationId()); if (actInstDescr == null) {
/** * To get the RuntimeAPI interface. * * @return the interface RuntimeAPI. */ public static RuntimeAPI getRuntimeAPI() { return getAPIAccessor().getRuntimeAPI(); }