use of org.jbpm.services.task.identity.JBossUserGroupCallbackImpl in project jbpm by kiegroup.
the class HumanTaskResolver method getRuntimeManager.
private RuntimeManager getRuntimeManager(String process, int i) {
Properties properties = new Properties();
properties.setProperty("krisv", "");
properties.setProperty("sales-rep", "sales");
properties.setProperty("john", "PM");
KnowledgeBuilder knowledgeBuilder = createKBuilder(process, ResourceType.BPMN2);
KieBase kieBase = knowledgeBuilder.newKieBase();
UserGroupCallback userGroupCallback = new JBossUserGroupCallbackImpl(properties);
// load up the knowledge base
TimerServiceRegistry.getInstance();
RuntimeEnvironment environment = RuntimeEnvironmentBuilder.Factory.get().newDefaultBuilder().userGroupCallback(userGroupCallback).persistence(true).entityManagerFactory(emf).knowledgeBase(kieBase).get();
return RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment, "id-" + i);
}
use of org.jbpm.services.task.identity.JBossUserGroupCallbackImpl in project jbpm by kiegroup.
the class JBPMHelper method getUserGroupCallback.
@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");
}
}
use of org.jbpm.services.task.identity.JBossUserGroupCallbackImpl in project jbpm by kiegroup.
the class JbpmJUnitTestCase method createKnowledgeBase.
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();
}
use of org.jbpm.services.task.identity.JBossUserGroupCallbackImpl in project jbpm by kiegroup.
the class PerCaseRuntimeManagerTest method setup.
@Before
public void setup() {
Properties properties = new Properties();
properties.setProperty("mary", "HR");
properties.setProperty("john", "HR");
userGroupCallback = new JBossUserGroupCallbackImpl(properties);
pds = TestUtil.setupPoolingDataSource();
emf = EntityManagerFactoryManager.get().getOrCreate("org.jbpm.persistence.jpa");
}
use of org.jbpm.services.task.identity.JBossUserGroupCallbackImpl in project jbpm by kiegroup.
the class PerProcessInstanceRuntimeManagerTest method setup.
@Before
public void setup() {
Properties properties = new Properties();
properties.setProperty("mary", "HR");
properties.setProperty("john", "HR");
userGroupCallback = new JBossUserGroupCallbackImpl(properties);
pds = TestUtil.setupPoolingDataSource();
emf = EntityManagerFactoryManager.get().getOrCreate("org.jbpm.persistence.jpa");
}
Aggregations