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.
no read XEvent
Hi all,
I have a new problem..
I used this code to find the name of the event XEvent, I just do not return the name of the event, I do not return anything.
What is wrong?
What is wrong?
Thank you!
for(XEvent event:trace2) {
try {
XExtendedEvent extendedEvent2 = XExtendedEvent.wrap(event);
String eventName2 = extendedEvent2.getName();
Date timestamp2 = extendedEvent2.getTimestamp();
}catch (Exception e) {
System.out.printf("Error into trace 2");
}
}
Answers
-
Hi Benfy85,I wonder what sort of "name" that you'd like to extract from an XEvent object. If you'd like to extract an event class/timestamp of an XEvent object from a log, what I typically do is write the following code:XLog log; // this is givenXTrace trace; // this is also givenXTimeExtension extractor = XTimeExtension.instance(); // utility object to extract timestampXLogInfoImpl logInfo = XLogInfoFactory.createLogInfo(log);XEventClasses eventClasses = logInfo.getEventClasses();for (XEvent event : trace){// extracting the name of the event class of the eventeventClasses.getClassOf(event).toString();// extracting its timestampDate timestamp = extractor.extractTimestamp(event);}I hope it helps,Regards,Arya
-
Thank you, I have been very helpful for your help.The eventName that I mean into "file.MXML" corrisponds to<WorkflowModelElement>eventName</WorkflowModelElement>and in this code return return the string "eventName+record".
that corrisponds to<WorkflowModelElement>eventName</WorkflowModelElement><EventType unknowntype="record">unknown</EventType>How can I get only the eventName?Thank youErika -
I found how to solve the problem, I used this code:int q=0;for(XEvent event:trace2) {
eventName1 = XConceptExtension.instance().extractName(trace2.get(q));q++;}
You have unlocked me.
Thank you,
Erika -
Hi Erika,
Why don't you do it like this?for(XEvent event:trace2) {}
String eventName1 = XConceptExtension.instance().extractName(event);
I do not see the need/use for the q index since in the for loop you already extract the events from the trace.
Joos Buijs
Senior Data Scientist and process mining expert at APG (Dutch pension fund executor).
Previously Assistant Professor in Process Mining at Eindhoven University of Technology -
You are right!I have not thought, because I used this code to get the track by:
XConceptExtension.instance () extractName (log.get(t)).But you have solved another problem that came out during the execution.Thank you,Erika
Howdy, Stranger!
Categories
- 1.6K All Categories
- 45 Announcements / News
- 225 Process Mining
- 6 - BPI Challenge 2020
- 9 - BPI Challenge 2019
- 24 - BPI Challenge 2018
- 27 - BPI Challenge 2017
- 8 - BPI Challenge 2016
- 68 Research
- 1K ProM 6
- 393 - Usage
- 287 - Development
- 9 RapidProM
- 1 - Usage
- 7 - Development
- 54 ProM5
- 19 - Usage
- 187 Event Logs
- 32 - ProMimport
- 75 - XESame