Expression based ETL examples

From QPR ProcessAnalyzer Wiki
Jump to: navigation, search
function ExportModelEvents(m) {
  let attrs = m.EventAttributes;
  ToDataFrame(
    m.EventLog.Events.Concat(
      [Case.Name, Type.Name, ToString(TimeStamp, "yyyy-MM-dd HH:mm:ss.fff")], 
      {let evt = _; attrs.{let att = _; evt.Attribute(att)}}
    ), 
    Concat(
      ["CaseId", "EventType", "TimeStamp"], 
      attrs.Name
    )
  ).ToCsv(true);
}

 

function ExportModelCases(m) {
  let attrs = m.CaseAttributes;
  ToDataFrame(
    m.EventLog.Cases.Concat(
      [Name], 
      {let cas = _; attrs.{let att = _; cas.Attribute(att)}}
    ), 
    Concat(
      ["CaseId"], 
      attrs.Name
    )
  ).ToCsv(true);
}
First(Models.Where(Name=="SAP OtC Extended")).EventsDataTable.DataFrame.ToCsv(true)
First(Models.Where(Name=="SAP OtC Extended")).CasesDataTable.DataFrame.ToCsv(true)