Refine search
@Before public void setup() { Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); pds = TestUtil.setupPoolingDataSource(); }
public JBossUserGroupCallbackImpl(String location) { Properties userGroups = readProperties(location, DEFAULT_PROPERTIES_LOCATION); logger.debug("Loaded properties {}", userGroups); init(userGroups); }
@Produces public UserGroupCallback getUserGroupCallback() { Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR,Accounting"); properties.setProperty("salaboy", "HR,IT,Accounting"); properties.setProperty("katy", "HR,IT,Accounting,admins"); return new JBossUserGroupCallbackImpl(properties); }
@Test public void testDeploymentDescriptorFromKieContainer() throws IOException { Map<String, String> resources = new HashMap<String, String>(); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); String kmoduleString = IOUtils.toString(this.getClass() .getResourceAsStream("/kmodule-custom-wih.xml"), "UTF-8"); resources.put("src/main/resources/META-INF/kmodule.xml", kmoduleString); String processString = IOUtils.toString(this.getClass() .getResourceAsStream("/BPMN2-CustomTask.bpmn2"), "UTF-8"); resources.put("src/main/resources/BPMN2-CustomTask.bpmn2", processString); InternalKieModule kJar1 = createKieJar(ks, releaseId, resources); installKjar(releaseId, kJar1); Properties properties = new Properties(); UserGroupCallback userGroupCallback = new JBossUserGroupCallbackImpl( properties); RuntimeEnvironment environment = RuntimeEnvironmentBuilder.Factory .get().newDefaultBuilder(releaseId) .userGroupCallback(userGroupCallback).get(); manager = RuntimeManagerFactory.Factory.get() .newPerProcessInstanceRuntimeManager(environment); manager.getRuntimeEngine(ProcessInstanceIdContext.get()) .getKieSession().startProcess("customtask"); }
@Deprecated @SuppressWarnings("unchecked") public static UserGroupCallback getUserGroupCallback() { Properties properties = getProperties(); String className = properties.getProperty("taskservice.usergroupcallback"); if (className != null) { try { Class<UserGroupCallback> clazz = (Class<UserGroupCallback>) Class.forName(className); return clazz.newInstance(); } catch (Exception e) { throw new IllegalArgumentException("Cannot create instance of UserGroupCallback " + className, e); } } else { return new JBossUserGroupCallbackImpl("classpath:/usergroups.properties"); } }
public static UserGroupCallback getUserGroupCallback() { UserGroupCallback callback = new MvelUserGroupCallbackImpl(true); if ("ldap".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new LDAPUserGroupCallbackImpl(true); } else if ("db".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new DBUserGroupCallbackImpl(true); } else if ("mvel".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new MvelUserGroupCallbackImpl(true); } else if ("props".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new JBossUserGroupCallbackImpl(true); } else if ("jaas".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new JAASUserGroupCallbackImpl(true); } else if ("custom".equalsIgnoreCase(USER_CALLBACK_IMPL)) { try { callback = (UserGroupCallback) Class.forName(CUSTOM_USER_CALLBACK_IMPL).newInstance(); } catch (Exception e) { throw new RuntimeException("Unable to create instance of custom user group callback impl", e); } } return callback; }
public JBossUserGroupCallbackImpl(Properties userGroups) { init(userGroups); }
public static UserGroupCallback getUserGroupCallback() { UserGroupCallback callback = new MvelUserGroupCallbackImpl(true); if ("ldap".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new LDAPUserGroupCallbackImpl(true); } else if ("db".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new DBUserGroupCallbackImpl(true); } else if ("mvel".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new MvelUserGroupCallbackImpl(true); } else if ("props".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new JBossUserGroupCallbackImpl(true); } else if ("jaas".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new JAASUserGroupCallbackImpl(true); } else if ("custom".equalsIgnoreCase(USER_CALLBACK_IMPL)) { try { callback = (UserGroupCallback) Class.forName(CUSTOM_USER_CALLBACK_IMPL).newInstance(); } catch (Exception e) { throw new RuntimeException("Unable to create instance of custom user group callback impl", e); } } return callback; }
@Before public void setup() { TestUtil.cleanupSingletonSessionId(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); }
/** * Builds a UserGroupCallback. * @return a UserGroupCallback */ public UserGroupCallback build() { UserGroupCallback callback = null; Properties properties = _propertiesBuilder.build(); if (_userGroupCallbackClass != null) { callback = construct(properties); } if (callback == null && USER_CALLBACK_IMPL != null) { try { if ("props".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new JBossUserGroupCallbackImpl(properties); } else { callback = UserDataServiceProvider.getUserGroupCallback(); } } catch (Throwable t) { // we might get here if on Karaf vs. JBoss // keep checkstyle happy ("at least one statement") t.getMessage(); } } if (callback == null) { callback = new PropertiesUserGroupCallback(properties); } return callback; }
@Before public void setup() { pds = TestUtil.setupPoolingDataSource(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); }
/** * Builds a UserGroupCallback. * @return a UserGroupCallback */ public UserGroupCallback build() { UserGroupCallback callback = null; Properties properties = _propertiesBuilder.build(); if (_userGroupCallbackClass != null) { callback = construct(properties); } if (callback == null && USER_CALLBACK_IMPL != null) { try { if ("props".equalsIgnoreCase(USER_CALLBACK_IMPL)) { callback = new JBossUserGroupCallbackImpl(properties); } else { callback = UserDataServiceProvider.getUserGroupCallback(); } } catch (Throwable t) { // we might get here if on Karaf vs. JBoss // keep checkstyle happy ("at least one statement") t.getMessage(); } } if (callback == null) { callback = new PropertiesUserGroupCallback(properties); } return callback; }
@Before public void setup() { TestUtil.cleanupSingletonSessionId(); pds = TestUtil.setupPoolingDataSource(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); taskEvents = new ArrayList<String>(); processEvents = new ArrayList<String>(); }
protected KieBase createKnowledgeBase(Map<String, ResourceType> resources) { RuntimeEnvironmentBuilder builder = null; if (!setupDataSource){ builder = RuntimeEnvironmentBuilder.Factory.get() .newEmptyBuilder() .addConfiguration("drools.processSignalManagerFactory", DefaultSignalManagerFactory.class.getName()) .addConfiguration("drools.processInstanceManagerFactory", DefaultProcessInstanceManagerFactory.class.getName()); } else if (sessionPersistence) { builder = RuntimeEnvironmentBuilder.Factory.get() .newDefaultBuilder(); } else { builder = RuntimeEnvironmentBuilder.Factory.get() .newDefaultInMemoryBuilder(); } builder.userGroupCallback(new JBossUserGroupCallbackImpl("classpath:/usergroups.properties")); for (Map.Entry<String, ResourceType> entry : resources.entrySet()) { builder.addAsset(ResourceFactory.newClassPathResource(entry.getKey()), entry.getValue()); } environment = builder.get(); return environment.getKieBase(); }
@Before public void setup() { TestUtil.cleanupSingletonSessionId(); pds = TestUtil.setupPoolingDataSource(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); }
private static RuntimeManager createRuntimeManager() { cleanupSingletonSessionId(); JBPMHelper.startH2Server(); JBPMHelper.setupDataSource(); EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa"); RuntimeEnvironmentBuilder builder = RuntimeEnvironmentBuilder.Factory.get() .newClasspathKmoduleDefaultBuilder() .entityManagerFactory(emf) .userGroupCallback(new JBossUserGroupCallbackImpl("classpath:/usergroups.properties")); return RuntimeManagerFactory.Factory.get() .newSingletonRuntimeManager(builder.get(), "com.sample:example:1.0"); }
@Before public void setup() { TestUtil.cleanupSingletonSessionId(); pds = TestUtil.setupPoolingDataSource(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); }
@Before public void setup() { TestUtil.cleanupSingletonSessionId(); pds = TestUtil.setupPoolingDataSource(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); }
@Before public void setup() throws NamingException { TestUtil.cleanupSingletonSessionId(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); createRuntimeManager(); }
@Before public void setup() { TestUtil.cleanupSingletonSessionId(); pds = TestUtil.setupPoolingDataSource(); Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); userGroupCallback = new JBossUserGroupCallbackImpl(properties); }