Examples of ProcessEntityHolder


Examples of org.jbpm.persistence.processinstance.ProcessEntityHolder

        super( cache );
    }

    public ProcessInstanceInfo persist(ProcessInstanceInfo processInstanceInfo) {
      String id = generateProcessInstanceInfoId(processInstanceInfo);
        getCache().put( id, new ProcessEntityHolder(id, processInstanceInfo) );
        return processInstanceInfo;
    }
View Full Code Here

Examples of org.jbpm.persistence.processinstance.ProcessEntityHolder

        return processInstanceInfo;
    }

    public ProcessInstanceInfo findProcessInstanceInfo(Long processInstanceId) {
      String key = inferProcessInstanceInfoId(processInstanceId);
        ProcessEntityHolder holder = (ProcessEntityHolder) getCache().get( key );
        if (holder == null) {
          return null;
        }
    return holder.getProcessInstanceInfo();
    }
View Full Code Here

Examples of org.jbpm.persistence.processinstance.ProcessEntityHolder

  private List<CorrelationKeyInfo> getCorrelationKeysByProcessInstanceId(Long pId) {
    Cache<String, Object> cache = getCache();
    List<CorrelationKeyInfo> retval = new ArrayList<CorrelationKeyInfo>();
    for (String key : cache.keySet()) {
      if (key.startsWith("correlationInfo")) {
        ProcessEntityHolder holder = (ProcessEntityHolder) cache.get(key);
        if (pId.equals(holder.getProcessInstanceId())) {
          retval.add(holder.getCorrelationKeyInfo());
        }
      }
    }
    return retval;
  }
View Full Code Here

Examples of org.jbpm.persistence.processinstance.ProcessEntityHolder

    public List<Long> getProcessInstancesWaitingForEvent(String type) {
      Cache<String, Object> cache = getCache();
      List<Long> retval = new ArrayList<Long>();
      for (String key : cache.keySet()) {
        if (key.startsWith("processInstanceInfo")) {
          ProcessEntityHolder holder = (ProcessEntityHolder) cache.get(key);
          if (holder != null && holder.getProcessInstanceEventTypes() != null) {
            if (holder.getProcessInstanceEventTypes().contains(type)) {
              retval.add(holder.getProcessInstanceId());
            }
          }
        }
      }
    return retval;
View Full Code Here

Examples of org.jbpm.persistence.processinstance.ProcessEntityHolder

        Long processInstanceId = getProcessInstanceByCorrelationKey(correlationKeyInfo);
        if (processInstanceId != null) {
            throw new RuntimeException(correlationKeyInfo + " already exists");
        }
      String id = generateCorrelationKeyInfoId(correlationKeyInfo);
        getCache().put( id, new ProcessEntityHolder(id, correlationKeyInfo) );
        return correlationKeyInfo;
    }
View Full Code Here

Examples of org.jbpm.persistence.processinstance.ProcessEntityHolder

      String propertiesString = ProcessEntityHolder.generateString(correlationKey.getProperties());
      Cache<String, Object> cache = getCache();
      List<Long> retval = new ArrayList<Long>();
      for (String key : cache.keySet()) {
        if (key.startsWith("correlationInfo")) {
          ProcessEntityHolder holder = (ProcessEntityHolder) cache.get(key);
          if (holder.getCorrelationKeyId() == correlationKey.getProperties().size()) {
            if (holder.getCorrelationKeyProperties().contains(propertiesString)) {
              retval.add(holder.getProcessInstanceId());
            }
          }
        }
      }
      return (retval.size() == 1) ? retval.iterator().next() : null;
View Full Code Here

Examples of org.jbpm.persistence.processinstance.ProcessEntityHolder

        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

Examples of org.jbpm.persistence.processinstance.ProcessEntityHolder

      Cache<String, Object> cache = cm.getCache("jbpm-configured-cache");
      Set<String> keyset = cache.keySet();
      ArrayList<ProcessInstanceInfo> retval = new ArrayList<ProcessInstanceInfo>();
      for (String key : keyset) {
        if (key.startsWith("processInstanceInfo")) {
          ProcessEntityHolder holder = (ProcessEntityHolder) cache.get(key);
          ProcessInstanceInfo procInstInfo = holder.getProcessInstanceInfo();
        retval.add(procInstInfo);
          logger.trace("> " + procInstInfo);
        }
      }
      return retval;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.