Examples of SerializablePersistedVariable


Examples of org.drools.persistence.processinstance.variabletypes.SerializablePersistedVariable

  public VariableInstanceInfo persistExternalVariable(String name, Object o,
      VariableInstanceInfo oldValue, Environment env) {
                boolean newVariable = false;
    EntityManager em = (EntityManager) env.get(EnvironmentName.CMD_SCOPED_ENTITY_MANAGER);
    SerializablePersistedVariable result = null;
                if(o == null || (oldValue != null && oldValue.getPersister().equals(""))){
                    return null;
                }
    if (oldValue instanceof SerializablePersistedVariable) {
      result = (SerializablePersistedVariable) oldValue;
    }
    if (result == null) {
      result = new SerializablePersistedVariable();
      newVariable = true;
     
    }
                result.setPersister(this.getClass().getName());
                result.setName(name);
    result.setContent(getBytes(o));
                if(newVariable){
                    em.persist(result);
                }else{
                    em.merge(result);
                }
View Full Code Here

Examples of org.drools.persistence.processinstance.variabletypes.SerializablePersistedVariable

  public VariableInstanceInfo persistExternalVariable(String name, Object o,
      VariableInstanceInfo oldValue, Environment env) {
                boolean newVariable = false;
    EntityManager em = (EntityManager) env.get(EnvironmentName.ENTITY_MANAGER);
    SerializablePersistedVariable result = null;
                if(o == null || (oldValue != null && oldValue.getPersister().equals(""))){
                    return null;
                }
    if (oldValue instanceof SerializablePersistedVariable) {
      result = (SerializablePersistedVariable) oldValue;
    }
    if (result == null) {
      result = new SerializablePersistedVariable();
      newVariable = true;
     
    }
                result.setPersister(this.getClass().getName());
                result.setName(name);
    result.setContent(getBytes(o));
                if(newVariable){
                    em.persist(result);
                }else{
                    em.merge(result);
                }
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.