public virtual HistoricVariableInstance build() { HistoricVariableInstance mockVariable = mock(typeof(HistoricVariableInstance)); when(mockVariable.Id).thenReturn(id_Renamed); when(mockVariable.Name).thenReturn(name_Renamed); when(mockVariable.VariableName).thenReturn(name_Renamed); when(mockVariable.TypeName).thenReturn(value.Type.Name); when(mockVariable.VariableTypeName).thenReturn(value.Type.Name); if (value.GetType().IsAssignableFrom(typeof(ObjectValue))) { ObjectValue objectValue = (ObjectValue)value; if (objectValue.Deserialized) { when(mockVariable.Value).thenReturn(value.Value); } else { when(mockVariable.Value).thenReturn(null); } } else { when(mockVariable.Value).thenReturn(value.Value); } when(mockVariable.TypedValue).thenReturn(value); when(mockVariable.ProcessDefinitionKey).thenReturn(processDefinitionKey_Renamed); when(mockVariable.ProcessDefinitionId).thenReturn(processDefinitionId_Renamed); when(mockVariable.ProcessInstanceId).thenReturn(processInstanceId_Renamed); when(mockVariable.ExecutionId).thenReturn(executionId_Renamed); when(mockVariable.ErrorMessage).thenReturn(errorMessage_Renamed); when(mockVariable.ActivtyInstanceId).thenReturn(activityInstanceId_Renamed); when(mockVariable.ActivityInstanceId).thenReturn(activityInstanceId_Renamed); when(mockVariable.CaseDefinitionKey).thenReturn(caseDefinitionKey_Renamed); when(mockVariable.CaseDefinitionId).thenReturn(caseDefinitionId_Renamed); when(mockVariable.CaseInstanceId).thenReturn(caseInstanceId_Renamed); when(mockVariable.CaseExecutionId).thenReturn(caseExecutionId_Renamed); when(mockVariable.TaskId).thenReturn(taskId_Renamed); when(mockVariable.TenantId).thenReturn(tenantId_Renamed); when(mockVariable.CreateTime).thenReturn(createTime_Renamed); when(mockVariable.RemovalTime).thenReturn(removalTime_Renamed); when(mockVariable.RootProcessInstanceId).thenReturn(rootProcessInstanceId_Renamed); return(mockVariable); }
// these functions serve to ensure that symbols in nodes are defined as the right type protected TypedValue DefSymbolValue(IdentNode node, TypedValue value) { if (node.Sym.IsValue && node.Sym.DataType == value.DataType) { return(node.Sym.Value); } Logger.WriteLine(3, "Getsym adding {0} value:{1} type:{2}", node.Sym.Name, value, value.DataType); // will create new symbol and store in symbol table, so other nodes see the same thing if (node.Sym.IsUndef) { Symbols.DefineValue(node.Name, value); } else if (value.GetType() == typeof(IdentValue) && node.Sym.Value is IdentValue) { ; // any subclass will do for flag. TODO: reverse operation if flag defined first } else { _currentparser.Syntax("already defined {0} as type {1}", node.Name, node.Sym.DataType); } return(value); }
public override string ToString() => $"{{\"type\":\"{TypedValue.GetType().Name}\",\"intValue\":{Convert.ToInt32(TypedValue)},\"name\":\"{TypedValue.ToString()}\",\"displayName\":\"{TypedValue.GetDescription()}\"}}";
public string GetCreationCode() => $"new Enum('{TypedValue.GetType().Name}',{Convert.ToInt32(TypedValue)},'{TypedValue.ToString()}','{TypedValue.GetDescription()}')";