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.

Visualisation

Assma
edited June 2012 in ProM 6
Hello,

I'm developping a plugin and I need to get the attached file visualised in my plugin .
How can I do to get the visualised structure of the plugin ( at left : the logs' names and at right the mined model that is related to the selected log)?

This is a part of my code:


@Plugin(name = "multi Alpha Miner", parameterLabels = { "Collections of event logs", "Summary", "Log Relations" }, returnLabels = { "BPMN model" },

        returnTypes = { BPMNDiagram.class }, userAccessible = true, help = "Produces the string: 'Hello world'")
        public class MultiAlphaMiner implements NodeExpander<Tuple> {
    private static List<XEventClass> eventClasses;
    private LogRelations relations;
    private static final String EXCLUSIVE_GATEWAY = "EXCLUSIVE-GATEWAY";
    private static final String INCLUSIVE_GATEWAY = "INCLUSIVE_GATEWAY";
    private static final String PARALLEL_GATEWAY = "PARALLEL-GATEWAY";

    @UITopiaVariant(uiLabel = "Mine for a BPMN model using multi-log alpha algorithm", affiliation = UITopiaVariant.EHV, author = "A. MEJRI", email = "mejri.assma@gmail.com", pack = "AlphaMiner")
    @PluginVariant(variantLabel = "Default event classes", requiredParameterLabels = { 0 })
   
    public BPMNDiagram multiAlphaMiner(PluginContext context, Object[] collection) throws CancellationException,
    ExecutionException, InterruptedException {

        XLogInfo summary = XLogInfoFactory.createLogInfo((XLog) collection[0]);
       
        System.out.println("collection 0 " + summary);
   
       
       

        BPMNDiagram diagram = BPMNDiagramFactory.newBPMNDiagram("BPMNDiagram");
       

        Collection<Pair<Integer, PluginParameterBinding>> plugins = context.getPluginManager().find(Plugin.class,
                LogRelations.class, context.getPluginContextType(), true, false, false, XLog.class, summary.getClass());
        Pair<Integer, PluginParameterBinding> plugin = plugins.iterator().next();
        PluginContext c2 = context.createChildContext("Log Relation Constructor");
        PluginExecutionResult pluginResult = plugin.getSecond().invoke(c2, collection[0], summary);
        pluginResult.synchronize();
        LogRelations relations = pluginResult.<LogRelations>getResult(plugin.getFirst());
        System.out.println(relations.getCausalDependencies());

   
       
        diagram = doAlphaMiningPrivateWithRelations(context, relations.getSummary(), relations);
            if ( collection[0] instanceof Object[]) {
            multiAlphaMiner(context, (Object[]) collection[0]);
            }
       

        return diagram;
    }
 
The work that I have done is resticted only to one model. I have to make changes that it visualises many digrams.

Please help
Thanks in advance

Best Answer

  • aadrians
    Accepted Answer
    Hi Assma, since you already managed to do it for one model, can you just repeat the call that you already did? As for the visualization, you can simply use existing java swing classes. 

    Regards,
    Arya
Sign In or Register to comment.