plugin/src/java/org/pm4knime/node/logmanipulation/merge/MergeUtil.java
public static XLog mergeLogsIgnoreTrace(XLog log0, XLog log1, List<String> tKeys, ExecutionContext exec)
			throws CanceledExecutionException {
		XLog mlog = XLogUtil.clonePureLog(log0, "Merged Log");
		mlog.getAttributes().putAll(log1.getAttributes());
		mlog.getGlobalTraceAttributes().addAll(log1.getGlobalTraceAttributes());
		mlog.getGlobalEventAttributes().addAll(log1.getGlobalEventAttributes());

		Set<String> caseIDSet = new HashSet();

		// put the first event log into the mlog
		for (XTrace trace : log0) {
			exec.checkCanceled();
			mlog.add((XTrace) trace.clone());

			// we need to get the values from it.. If we have string format
			// it is totally fine for me
			String attrValue = trace.getAttributes().get(tKeys.get(0)).toString();
			caseIDSet.add(attrValue);
		}

		// put the first event log into the mlog
		for (XTrace trace : log1) {
			exec.checkCanceled();
			String attrValue = trace.getAttributes().get(tKeys.get(1)).toString();
			if (!caseIDSet.contains(attrValue)) {
				mlog.add((XTrace) trace.clone());
			}

		}
		return mlog;
	}
// merge log with ignore second log strategy. But simple ignore the trace
merge log with ignore second log strategy. But simple ignore the trace
merge log with ignore second log strategy . But simple ignore the trace
public static XLog mergeLogsIgnoreTrace(XLog log0, XLog log1, List<String> tKeys, ExecutionContext exec)
			throws CanceledExecutionException {
		XLog mlog = XLogUtil.clonePureLog(log0, "Merged Log");
		mlog.getAttributes().putAll(log1.getAttributes());
		mlog.getGlobalTraceAttributes().addAll(log1.getGlobalTraceAttributes());
		mlog.getGlobalEventAttributes().addAll(log1.getGlobalEventAttributes());
		Set<String> caseIDSet = new HashSet();
		for (XTrace trace : log0) {
			exec.checkCanceled();
			mlog.add((XTrace) trace.clone());
			String attrValue = trace.getAttributes().get(tKeys.get(0)).toString();
			caseIDSet.add(attrValue);
		}
		for (XTrace trace : log1) {
			exec.checkCanceled();
			String attrValue = trace.getAttributes().get(tKeys.get(1)).toString();
			if (!caseIDSet.contains(attrValue)) {
				mlog.add((XTrace) trace.clone());
			}
		}
		return mlog;
	}
public static XLog mergeLogsIgnoreTrace ( XLog log0 , XLog log1 , List < String > tKeys , ExecutionContext exec ) throws CanceledExecutionException { XLog mlog = XLogUtil . clonePureLog ( log0 , "Merged Log" ) ; mlog . getAttributes ( ) . putAll ( log1 . getAttributes ( ) ) ; mlog . getGlobalTraceAttributes ( ) . addAll ( log1 . getGlobalTraceAttributes ( ) ) ; mlog . getGlobalEventAttributes ( ) . addAll ( log1 . getGlobalEventAttributes ( ) ) ; Set < String > caseIDSet = new HashSet ( ) ; for ( XTrace trace : log0 ) { exec . checkCanceled ( ) ; mlog . add ( ( XTrace ) trace . clone ( ) ) ; String attrValue = trace . getAttributes ( ) . get ( tKeys . get ( 0 ) ) . toString ( ) ; caseIDSet . add ( attrValue ) ; } for ( XTrace trace : log1 ) { exec . checkCanceled ( ) ; String attrValue = trace . getAttributes ( ) . get ( tKeys . get ( 1 ) ) . toString ( ) ; if ( ! caseIDSet . contains ( attrValue ) ) { mlog . add ( ( XTrace ) trace . clone ( ) ) ; } } return mlog ; }
merge log with ignore second log strategy.
merge log with ignore second log strategy .
// put the first event log into the mlog // we need to get the values from it.. If we have string format // it is totally fine for me // put the first event log into the mlog