Please enable JavaScript to view this site.

mpmX Help Documentation

Navigation: English > Data Engineer Guide > Create an Event Log from Your Data Sources > Generate Events

Create New Events by Creating Event Sources for Traditional Mining

Scroll Previous Topic Top Next Topic More

 

The main concept of creating an event is to create a table and then to apply a “where” statement to this table to match the specific conditions of each event. This table is named an  “eventSourceTable” and can be the direct output tables of the Transform-Phase or the combination of several tables from the Transform-Phase. To explain this part, the event creation steps are listed and then, at each step an example with the “Create Purchase Order” event is described.

 

The steps to create an event are:

1.Copy and paste the content of the “custom_logic_03eventsource.qvs” scenario to “custom_logic_03eventsource_ eventSourceName.qvs”.

2.Verify, that the mpmXvAppConfigAlias in your TaskApp matches your scenario name e.g. 03eventsource_ eventSourceName.

3.Give an understandable name to the event source in the variable “eventSourceName”.

 

Example

 

let eventSourceName = 'ChangeLog_RSEG';

 

 

4.Fill in the inline table “activityScenarioFieldsTable”. This table has the fields:

process

Set it to “y” to load the activity. Set it to “n” to not load it. This is useful for singularly debugging one activity.

ActivityTypeID

Unique ID number of the activity.

ActivityType

Name of the activity type.

ActivityTypeDescription_EN

Description/name of the activity. These are the activity names shown in the ProcessAnalyzer.

By changing the field name (i.e. to ActivityTypeDescription_DE for german language) different languages can be set. For this, you need to include the activity names in the corresponding language.

QlikSourceWhereFilter

This is a where statement that is applied to the event source table to obtain the required event.

 

Example

 

process

Set it to “y”, because the activity should be loaded.

ActivityTypeID

Any number can be chosen. For this example, the ID 300 was selected.

ActivityType

Create Purchase Order

ActivityTypeDescription_DE

Lege Bestellung an

QlikSourceWhereFilter

As before explained:

CDHDR_OBJECTCLAS = 'EINKBELEG' AND CDPOS_TABNAME = 'EKKO' AND CDPOS_FNAME = 'KEY' AND CDPOS_CHNGIND = 'I'

 

 

NoConcatenate

activityScenarioFieldsTable:

LOAD * Inline [        

process,

ActivityTypeID,

ActivityType,

ActivityTypeDescription_EN,

QlikSourceWhereFilter

y,

300,

CreatePurchaseOrder,

Create order,

CDHDR_OBJECTCLAS = 'EINKBELEG' AND CDPOS_TABNAME = 'EKKO' AND CDPOS_FNAME = 'KEY' AND CDPOS_CHNGIND = 'I'

];

 

 

5.Create your eventSourceTable in the way needed to obtain the required events.

Info

Don’t forget to include the process mining required fields: CaseID, ActivityStartTimestamp and ActivityEndTimestamp, ActivityUserName and ActivityOriginID (ProcessAnalyzer fields) in this process.

 

Example

 

eventSourceTable:

LOAD

[CDPOS_MANDANT] & '_' & [CDPOS_OBJECTCLAS] & '_' & [CDPOS_OBJECTID] & '_' & [CDPOS_CHANGENR] & '_' & [CDPOS_TABNAME] & '_' & [CDPOS_TABKEY] & '_' & [CDPOS_FNAME] & '_' & [CDPOS_CHNGIND] as [%CDPOS_PKEY],

       '030_' & mid(CDPOS_TABKEY410as %EKKO_PKEY,

       CDPOS_TABNAME,

       CDPOS_FNAME,

       CDPOS_CHNGIND,

       CDHDR_AETST,

       CDHDR_OBJECTCLAS,

       CDHDR_USERNAME

FROM [$(mpmXvETLFolder)02_Transform/views/CDHDR_CDPOS_EINKBELEG.qvd] (qvd);

inner join (eventSourceTable)

Load

       RSEG_BELNR & '_' & RSEG_MANDT & '_' & RSEG_BUKRS & '_' & RSEG_GJAHR as CaseID_RSEG,

       RSEG_MANDT & '_' & RSEG_EBELN as %EKKO_PKEY

FROM [$(mpmXvETLFolder)01_Extract/transformed/RSEG.qvd] (qvd);

 

 

6.Finally, the process mining fields are included in the finalEventSourceTable.

 

Example

 

NoConcatenate

finalEventSourceTable:

Load *,

CaseID_RSEG as CaseID,

CDHDR_AETST as ActivityStartTimestamp,

CDHDR_AETST as ActivityEndTimestamp,

CDHDR_USERNAME as ActivityUserName,

%CDPOS_PKEY as ActivityOriginID

Resident eventSourceTable

 

 

Info

Non-mandatory fields are not stored in the eventSource unless you list them in the variable mvEventFieldsToKeep.

We recommend loading each event source individually to avoid errors, therefore set mvExecuteEventSourceMining to 1 and load one scenario at a time.

 

7.To execute multiple eventsource scenarios your TaskApp should look like this:

 

 

Example

 

SET mpmXvAppConfigAlias = '03eventsource_part1';  //the file name should then be custom_logic_03eventsource_part1-qvs;

$(Must_Include='lib://mpmX_scripts/V2.3.0/mpmX_api.qvs'); 

 

call mpmX_execute; 

 

SET mpmXvAppConfigAlias = '03eventsource _part2'; 

 

$(Must_Include='lib://mpmX_scripts/V2.3.0/mpmX_api.qvs'); 

 

call mpmX_execute; 

 

exit script; 

 

8.Once the event source is defined, use the 04processlog scenario.

 

 

 

© by MEHRWERK GmbH