Die Dokumentation in diesem Bereich ist im Aufbau.

Struktur

Workflow Scripting

                Nutzung des Script Editors

                Scripting – Nutzbarer Umfang

  • Welche Namespaces aus .NET können verwendet werden?

String.* …. bitte Liste klären….


Scripting Environment

context

1
2
3
4
5
6

public interface IWorkflowContext
{
    IWorkflowContext Parent { get; set; }
    IResultTablesAccess ResultTableAccess { get; }
    Dictionary<string, string> Record { get; }
}


acess/ context.Parent.ResultTableAccess

1
2
3
4
5
6
7
8
9

public interface IResultTablesAccess
{
   ResultTable GetResultTable(string tableName);
   bool Contains(string tableName);
   void Add(string tableName, ResultTable resultTable);
   void AddColumn(string resultTableName, string columnName);
   void RenameColumn(string resultTableName, string columnName, string newColumnName);
   void DeleteColumn(string resultTableName, string columnName);
}


logger.debug

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

public interface ILogger
{
    bool IsDebugEnabled { get; }
    event LogEventHandler<DebugEventArgs> DebugLogged;
    event LogEventHandler<InfoEventArgs> InfoLogged;
    event LogEventHandler<ErrorEventArgs> ErrorLogged;
    event LogEventHandler<WarnEventArgs> WarnLogged;
    event LogEventHandler<FatalEventArgs> FatalLogged;
    void Debug(string user, string functionName, long functionTime, object message);
    void Debug(string user, string functionName, long functionTime, object message, string[] fields, string[] record);
    void Debug(string user, string functionName, long functionTime, object message, string[] fields, string[][] records);
    void Debug(string user, string functionName, long functionTime, object message, string[] values);
    void Debug(string user, string functionName, long functionTime, object message, string[][] records);
    void Error(string user, string functionName, long functionTime, Exception ex);
    void Error(string user, string functionName, long functionTime, object message);
    void Fatal(string user, string functionName, long functionTime, Exception ex);
    void Fatal(string user, string functionName, long functionTime, object message);
    void Info(string user, string functionName, long functionTime, object message);
    void Info(string user, string functionName, long functionTime, object message, string[] fields, string[] record);
    void Info(string user, string functionName, long functionTime, object message, string[] fields, string[][] record);
    void Info(string user, string functionName, long functionTime, object message, string[] values);
    void Info(string user, string functionName, long functionTime, object message, string[][] records);
    void Warn(string user, string functionName, long functionTime, Exception ex);
    void Warn(string user, string functionName, long functionTime, object message);
}


ResultTable

public class ResultTable : IEnumerable<WorkflowRecord>
{
   public string Name { get; set; }
   public List<WorkflowRecord> RecordTable { get; set; } = new List<WorkflowRecord>();
   public int CurrentIndex { get; set; }
   public int RecordCount => RecordTable.Count;
   public IEnumerator GetEnumerator()
   {
       return RecordTable.GetEnumerator();
   }
   public string Record(string field)
   public IEnumerator<WorkflowRecord> IEnumerable_GetEnumerator()
   {
       return RecordTable.GetEnumerator();
   }
   public void AddRecord(WorkflowRecord record)
   {
       RecordTable.Add(record);
   }
   public WorkflowRecord GetRecord(int index)
   public void AddColumn(string columnName)
   public void RenameColumn(string existingColumnName, string newColumnName)
   public void DeleteColumn(string columnName)
}


WorkflowRecord

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

public class WorkflowRecord : ICloneable
{
        public string Username { get; set; }
        public WorkflowRecord ParentRecord { get; set; }
        public string WorkflowSettingName { get; set; }
        public bool CanChangeFieldStructure { get; private set; }
        public string[] Fields => GetCollectionItems(FieldsValues.Keys).ToArray();
        public IDataStorageContainer DataStorageContainer { get; private set; } = new DataStorageContainer();
        public string[] Values => GetCollectionItems(FieldsValues.Values).ToArray();
        public Dictionary<string, object> GetFieldsValuesObject
        public Dictionary<string, string> FieldsValues { get; private set; } = new Dictionary<string, string>();
        public object Clone()
        public void LogActivityStatus(string logMessage)
        public void ApplyWorkflowRecord(WorkflowRecord workflowRecord, string workflowprefix)
        public void ApplyWorkflowRecord(WorkflowRecord workflowRecord)
        public string GetOriginalFieldName(string fieldname)
        public bool FieldNameExist(string fieldName)
        public void RenameField(string fieldName, string newFieldName)
        public string GetValuesFromFieldNames(string[] fieldnames, string delimiter, bool ignoreDoubleValues)
        public void SetValue(string fieldname, string value)
        public string GetValue(string fieldname)
        public bool GetBooleanValue(string fieldname)
        public double GetDoubleValue(string fieldname)
        public string[][] GetNormalizedStringArray()
        public string[][] GetStringArray()
        public void AddItemToTempStorage<T>(string key, T item)
        public T GetItemFromTempStorage<T>(string key)
        public void RemoveItemFromTempStorage(string key)
        private static List<T> GetCollectionItems<T>(IEnumerable<T> collection)
        public void RemoveField(string fieldname)
        public void AppendField(string fieldname, string value)
        public void AppendField(string fieldname)
        public void Clear() // Leert alle Fieldvalues.
        public void AddColumnToResultTable(string resultTableName, string columnName)
        public void RenameResultTableColumn(string resultTableName, string columnName, string newColumnName)
        public void DeleteResultTableColumn(string resultTableName, string columnName)
}


Verhalten im Standard-Kontext

logger-Objekt

 context-Objekt

 access-Objekt

                              

Verhalten in der Ergebnistabellen-Sequenz                                      

context.Parent.ResultTableAccess

                       

Tabellenverarbeitung

ResultTable

WorkflowRecord



Lösungsbeispiele

  • No labels