⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 variableupdatelogimpl.java

📁 一个java工作流引擎
💻 JAVA
字号:
package org.jbpm.model.log.impl;

import org.jbpm.model.execution.impl.*;
import org.jbpm.model.log.*;

public class VariableUpdateLogImpl extends ExecutionLogImpl implements VariableUpdateLog {

  private String oldValueText = null;
  private String newValueText = null;
  private VariableInstanceImpl variableInstance = null;
  private Object oldValue = null;
  private Object newValue = null;
  
  public VariableUpdateLogImpl() {}

  public VariableUpdateLogImpl( VariableInstanceImpl variableInstance, 
                                String oldValueText,
                                Object oldValue,
                                String newValueText,
                                Object newValue ) {
    this.variableInstance = variableInstance;
    this.oldValueText = oldValueText;
    this.oldValue = oldValue;
    this.newValueText = newValueText;
    this.newValue = newValue;
  }

  public String getOldValueText() { return this.oldValueText; }
  public void setOldValueText(String oldValueText) { 
    this.oldValueText = oldValueText;
    assemble();
  }

  public String getNewValueText() { return this.newValueText; }
  public void setNewValueText(String newValueText) { 
    this.newValueText = newValueText; 
    assemble();
  }

  public VariableInstanceImpl getVariableInstance() { return this.variableInstance; }
  public void setVariableInstance(VariableInstanceImpl variableInstance) { 
    this.variableInstance = variableInstance; 
    assemble();
  }
  
  public Object getOldValue() { return this.oldValue; }
  public Object getNewValue() { return this.newValue; }

  public String getVariableName() {
    return variableInstance.getName();
  }
  
  public void assemble() {
		if ( variableInstance != null ) {
		  if ( oldValueText != null ) oldValue = variableInstance.deserialize( oldValueText );
		  if ( newValueText != null ) newValue = variableInstance.deserialize( newValueText );
		}
  }
  
  public String toString() {
    return "[" + variableInstance.getName() + "]='" + newValueText + "'";
  }

	public void undo(ExecutionContextImpl executionContext) {
    variableInstance.setSerializedValue( oldValueText );
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -