plugin/src/java/org/pm4knime/util/XLogUtil.java
public static XLog[] splitLogByEventAttr(XLog log, String key, String value) {
		XLog klog = XLogUtil.clonePureLog(log, " kept log");
		XLog dlog = XLogUtil.clonePureLog(log, " disposed log");

		XTrace kTrace, dTrace;
		for (XTrace trace : log) {
			kTrace = pureClone(trace);
			dTrace = pureClone(trace);
			for (XEvent event : trace) {

				if (event.getAttributes().containsKey(key)) {
					XAttribute attr = event.getAttributes().get(key);
					if (attr.toString().equals(value)) {
						kTrace.add((XEvent) event.clone());
						continue;
					}
				}
				// one thing, to remove only according to index, the index changes
				dTrace.add((XEvent) event.clone());
			}

			if (kTrace.size() > 0)
				klog.add(kTrace);
			if (dTrace.size() > 0)
				dlog.add(dTrace);
		}

		return new XLog[] { klog, dlog };
	}
/**
	 * split event log by event attributes. If there is one event, we need to save
	 * trace there
	 * 
	 * @param log
	 * @param key
	 * @param value
	 * @return
	 */
split event log by event attributes. If there is one event, we need to save
trace there


split event log by event attributes . If there is one event we need to save trace there
public static XLog[] splitLogByEventAttr(XLog log, String key, String value) {
		XLog klog = XLogUtil.clonePureLog(log, " kept log");
		XLog dlog = XLogUtil.clonePureLog(log, " disposed log");
		XTrace kTrace, dTrace;
		for (XTrace trace : log) {
			kTrace = pureClone(trace);
			dTrace = pureClone(trace);
			for (XEvent event : trace) {
				if (event.getAttributes().containsKey(key)) {
					XAttribute attr = event.getAttributes().get(key);
					if (attr.toString().equals(value)) {
						kTrace.add((XEvent) event.clone());
						continue;
					}
				}
				dTrace.add((XEvent) event.clone());
			}
			if (kTrace.size() > 0)
				klog.add(kTrace);
			if (dTrace.size() > 0)
				dlog.add(dTrace);
		}
		return new XLog[] { klog, dlog };
	}
public static XLog [ ] splitLogByEventAttr ( XLog log , String key , String value ) { XLog klog = XLogUtil . clonePureLog ( log , " kept log" ) ; XLog dlog = XLogUtil . clonePureLog ( log , " disposed log" ) ; XTrace kTrace , dTrace ; for ( XTrace trace : log ) { kTrace = pureClone ( trace ) ; dTrace = pureClone ( trace ) ; for ( XEvent event : trace ) { if ( event . getAttributes ( ) . containsKey ( key ) ) { XAttribute attr = event . getAttributes ( ) . get ( key ) ; if ( attr . toString ( ) . equals ( value ) ) { kTrace . add ( ( XEvent ) event . clone ( ) ) ; continue ; } } dTrace . add ( ( XEvent ) event . clone ( ) ) ; } if ( kTrace . size ( ) > 0 ) klog . add ( kTrace ) ; if ( dTrace . size ( ) > 0 ) dlog . add ( dTrace ) ; } return new XLog [ ] { klog , dlog } ; }
split event log by event attributes.
split event log by event attributes .
// one thing, to remove only according to index, the index changes