Demo Organization on Workflow - pm4knime/pm4knime-document GitHub Wiki

This part demonstrates the methods in KNIME to clean up workflow and provide better organization on workflow. One example workflow is to filter out the traces which are started before one date at first. Next, the kept traces after this time are used to discover one Petri net. To clean up the workflow, the filtering operation is wrapped as node Preparation.

https://github.com/pm4knime/pm4knime-document/blob/master/images/demo-advanced-wrap-02.PNG

The workflow before the wrapping is shown in the following figure. image There are two ways to wrap the nodes, one way is to create MetaNode, another way is to create Component. The difference can be found in this link. Below, both methods are shown. The MetaNode is shown as first. image After opening the MetaNode, it looks like image Organized in Component. image After opening the MetaNode, it looks like image

The following steps show how to wrap the workflow.

  1. Create the workflow with all nodes expanded.
  • Download the dataset chapter_1 from the github link and extract it to get the event log running-example.csv.

  • Import running-example.csv with node CSV Reader.

  • Define a Flow Variable startDateVar in String with node String Input. This Flow Variable startDateVar defines the filtering criteria. After this date, all the events are filtered out.
    image

  • Filter the events rows out if its timestamp is before the defined startDateVar.

  • Drag node Rule-based Row Splitter into KNIME. This node outputs two Data Tables, one contains rows matching the rule, the other rows are contained in the second Data Table. More information can also be found in the vidoe.

  • Connect the node Rule-based Row Splitter with the output port of String Input and of CSV Reader.

  • Configure Rule-based Row Splitter with the following condition.

$#Event Attribute#time:timestamp$ >= $${SstartDateVar}$$ => TRUE

image

  • After execution, two tables are output as shown in the following. image

image

  • Extract the caseIDs from the second Data Table which start before the startDateVar by node GrouBy. image image
  • Filter out the rows with the caseIDs from the result of GroupBy.
  • Import the node Reference Row Filter. The configuration is like image
  • Execute Reference Row Filter and get the result image
  • Convert CSV into an event log
  • Discover a Petri net with node Inductive Miner. The settings are

Strategy: Inductive Miner -Infrequent Noise Threshold: 0.2

  • Replay the event log on the Petri net with node Alignment-Based Replayer(Default).
  • Check the fitness with node Fitness Checker.
  1. Wrap the nodes from CSV Reader to Inductive Miner as the node Preparation.
  • Select the related nodes, right click and choose Create Metanode image
  • After this, it generates the result like this, Its configuration contains no option. image

However, in the MetaNode, the startDataVar can't be modified to allow flexible settings. To allow the MetaNode configurable, we use another method Component.

  • Select the related nodes, right click and choose Create Component image
  • After this, it generates the result like this, Its configuration contains option like defined in node String Input. image

This section is more applicable on complex workflow.