To prevent spam users, you can only post on this forum after registration, which is by invitation. If you want to post on the forum, please send me a mail (h DOT m DOT w DOT verbeek AT tue DOT nl) and I'll send you an invitation in return for an account.

How to find activity sequence within the XLog?

I am trying to find the sequence pattern with all my activities under the cases. I have already imported the xes file using OpenXES in a XLog object in my Java class. From attributes I can access all the activities. Is there any functionality provided by OpenXES where I can find a pattern of activities and also determine what are the next activities.

Comments

  • Hi,

    No, OpenXES supports storage (including import and export to file) of an XLog object and access to it, but that's about it. It does not do any discovery-related tasks. That's left for the discovery plugins in ProM.

    Many discovery plugins rely on the so-called directly-follows graph (DFG), which is a graph where the activities are the nodes and every edge indicates that the source activity was directly followed in the log by the target activity. The Alpha Miner and Inductive Miner are two of the discovery algorithms that rely on this DFG. Possibly, you can use this DFG as well, and use existing code from either miner to get the DFG.

    Kind regards,
    Eric.
  • Hi @hverbeek
    Where can i find the existing code for either miner. I have used them as a plugin beforehand but is there a way to call another plugin or use them from my plugin?

    Regards
    Shahriar
  • hverbeek
    edited February 2021
    Hi @Fayme,

    You can find the code for both miners in their respective packages. On https://svn.win.tue.nl/trac/prom/wiki/ProM610/Plugins and https://svn.win.tue.nl/trac/prom/wiki/ProM610/Variants you will find two overviews that contain all plugins and plugin variants and in which package they are contained.

    On these lists, you can find the plugin you are interested in, and then find the name of its package. Every package can be checked out from https://svn.win.tue.nl/repos/prom/Packages/<packagename>/Trunk.

    You can call other plugins from your plugin by using their name. To call, for example, the Inductive Miner plugin with parameters, which has name "Mine Petri net with Inductive Miner, with parameters", you can use the following code snippet:

            MiningParameters minerParameters = createParameters();
            minerParameters.setClassifier(parameters.getClassifier());
            // Set your own parameters here.
            PackageManager.getInstance().findOrInstallPackages("InductiveMiner");
            Petrinet pn = context.tryToFindOrConstructFirstNamedObject(Petrinet.class,       
            "Mine Petri net with Inductive Miner, with parameters", null, null, eventLog, minerParameters);
            return pn;

    Here, context is your current PluginContext, and eventLog is the input log from which you need to discover a Petri net using the Inductive Miner. The method tryToFindOrConstructFirstNamedObject does the heavy work. As first argument, it takes the class of object that you want it to return, as the second argument the name of the plugin to use, the third and fourth argument can be set to null as in the snippet, the remaining (fifth, sixth, seventh, ...) arguments are to be used as the input parameters for the plugin (in this case: the event log and the selected parameters). This works also for other plugins.

    I hope this answers your question.

    Kind regards,
    Eric.



  • Thanks Eric. But how to import Petrinet in my class. It doesn't show suggestions in the code.
  • hverbeek
    edited February 2021
    Hi,

    Petri nets are defined in the PetriNets package. Please add the following line to your ivy.xml file:

          <dependency org="prom" name="PetriNets" rev="latest" changing="true" transitive="true" />
    Then have Ivy resolve all dependencies (right-click you project, select "Ivy / Resolve"). This will pull the PetriNets package into your project, after which you can select the class org.processmining.models.graphbased.directed.petrinet.Petrinet.

    Kind regards,
    Eric.


  • Fayme
    edited February 2021
    Sorry, but there is no ivy.xml file in the project. I have cloned this project from svn using eclipse. Just testing in the given package.

  • Hi,

    This is a project for the ProM framework that is not really being used anymore (as it does not use Ivy). As you need to depend on PetriNets anyway, it may an idea to clone the PetriNets package from SVN (https://svn.win.tue.nl/repos/prom/Packages/PetriNets/Trunk) using Eclipse. You wil then get a local working copy for that package in which you can add your own plugins. By starting ProM using the "ProM with UITopia (PetriNets).launch" file in that package, ProM will start in such a way that your plugins will be included.

    Work on ProM plugins is typically done in the ProM packages, and not in the ProM framework itself.

    Kind regards,
    Eric.


Sign In or Register to comment.