private HashMap<String, Object> context;
@Before
public void before() throws Exception {
context = setupWithPoolingDataSource(JBPM_PERSISTENCE_UNIT_NAME, false);
CorrelationKeyFactory factory = KieInternalServices.Factory.get().newCorrelationKeyFactory();
// populate table with test data
DefaultCacheManager cm = (DefaultCacheManager) context.get(EnvironmentName.ENTITY_MANAGER_FACTORY);
UserTransaction ut = InitialContext.doLookup("java:comp/UserTransaction");
if (ut.getStatus() == Status.STATUS_NO_TRANSACTION) {
ut.begin();
}
Cache <String, Object> cache = cm.getCache("jbpm-configured-cache");
cache.put("correlationInfo1", new ProcessEntityHolder("correlationInfo1", (CorrelationKeyInfo) factory.newCorrelationKey("test123")));
List<String> props = new ArrayList<String>();
props.add("test123");
props.add("123test");
cache.put("correlationInfo2", new ProcessEntityHolder("correlationInfo2", (CorrelationKeyInfo) factory.newCorrelationKey(props)));
if (ut.getStatus() == Status.STATUS_ACTIVE) {
ut.commit();
}
}