Examples of HistoricVariableInstance


Examples of org.camunda.bpm.engine.history.HistoricVariableInstance

  public String getActivityInstanceId() {
    return activityInstanceId;
  }

  public HistoricVariableInstance build() {
    HistoricVariableInstance mockVariable = mock(HistoricVariableInstance.class);
    when(mockVariable.getId()).thenReturn(id);
    when(mockVariable.getName()).thenReturn(name);
    when(mockVariable.getVariableName()).thenReturn(name);
    when(mockVariable.getTypeName()).thenReturn(value.getType().getName());
    when(mockVariable.getVariableTypeName()).thenReturn(value.getType().getName());

    if (ObjectValue.class.isAssignableFrom(value.getClass())) {
      ObjectValue objectValue = (ObjectValue) value;
      if (objectValue.isDeserialized()) {
        when(mockVariable.getValue()).thenReturn(value.getValue());
      } else {
        when(mockVariable.getValue()).thenReturn(null);
      }
    } else {
      when(mockVariable.getValue()).thenReturn(value.getValue());
    }

    when(mockVariable.getTypedValue()).thenReturn(value);
    when(mockVariable.getProcessInstanceId()).thenReturn(processInstanceId);
    when(mockVariable.getErrorMessage()).thenReturn(errorMessage);
    when(mockVariable.getActivtyInstanceId()).thenReturn(activityInstanceId);
    when(mockVariable.getActivityInstanceId()).thenReturn(activityInstanceId);

    return mockVariable;
  }
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.