Package org.kie.internal.process

Examples of org.kie.internal.process.CorrelationKeyFactory


    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();
        }
    }
View Full Code Here


    @Test
    public void testCreateCorrelationMultiValueDoesMatch() throws Exception {
        DefaultCacheManager cm = (DefaultCacheManager) context.get(EnvironmentName.ENTITY_MANAGER_FACTORY);
        Cache<String, Object> cache = cm.getCache("jbpm-configured-cache");
       
        CorrelationKeyFactory factory = KieInternalServices.Factory.get().newCorrelationKeyFactory();
        List<String> props = new ArrayList<String>();
        props.add("test123");
        props.add("123test");
        CorrelationKeyInfo correlationKey = (CorrelationKeyInfo) factory.newCorrelationKey(props);

        Long processInstance = new InfinispanProcessPersistenceContext(cache).getProcessInstanceByCorrelationKey(correlationKey);
       
        assertNotNull(processInstance);
        assertEquals(correlationKey.getProcessInstanceId(), processInstance.longValue());
View Full Code Here

TOP

Related Classes of org.kie.internal.process.CorrelationKeyFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.