plugin/src/java/org/pm4knime/node/conversion/log2table/FromXLogConverter.java
static DataTableSpec createGlobalSpec(XLog log) {
		
		System.out.println("Begin reading attributes");
		String tName = XLog2TableConverterNodeModel.CFG_TABLE_NAME;;
		
		
		List<String> attrNames = new ArrayList();
		List<DataType> attrTypes = new ArrayList();
		
		// what if people partially store sth. in global attributes, sth not there??
		// so we need to insist on the trace attribute, but don't forget the global attributes there
		
		// another thing if there are sth overlapping of event attributes and trace attributes
		// we need to have a test on it
		List<XAttribute> traceAttrs = log.getGlobalTraceAttributes();
		for(XAttribute attr : traceAttrs) {
			attrNames.add(XLogSpecUtil.TRACE_ATTRIBUTE_PREFIX +attr.getKey());
			attrTypes.add(findDataType(attr));
		}
		
		List<XAttribute> eventAttrs = log.getGlobalEventAttributes();
		
		for(XAttribute attr : eventAttrs) {
			attrNames.add(XLogSpecUtil.EVENT_ATTRIBUTE_PREFIX  + attr.getKey());
			attrTypes.add(findDataType(attr));
		}
		
		System.out.println("Finish reading attributes");
		// after getting all the attributes, we creat name and types for them
		String[] colNames = new String[attrNames.size()];
		attrNames.toArray(colNames);
		DataType[] colTypes = new DataType[attrTypes.size()];
		attrTypes.toArray(colTypes);
		
		// DataTableSpec.createColumnSpecs(colNames, colTypes);
		DataTableSpec outSpec = new DataTableSpec(tName, colNames, colTypes);
		
		return outSpec;
	}
// we need to get all the attributes of an xlog
we need to get all the attributes of an xlog
we need to get all the attributes of an xlog
static DataTableSpec createGlobalSpec(XLog log) {
		System.out.println("Begin reading attributes");
		String tName = XLog2TableConverterNodeModel.CFG_TABLE_NAME;;
		List<String> attrNames = new ArrayList();
		List<DataType> attrTypes = new ArrayList();
		List<XAttribute> traceAttrs = log.getGlobalTraceAttributes();
		for(XAttribute attr : traceAttrs) {
			attrNames.add(XLogSpecUtil.TRACE_ATTRIBUTE_PREFIX +attr.getKey());
			attrTypes.add(findDataType(attr));
		}
		List<XAttribute> eventAttrs = log.getGlobalEventAttributes();
		for(XAttribute attr : eventAttrs) {
			attrNames.add(XLogSpecUtil.EVENT_ATTRIBUTE_PREFIX  + attr.getKey());
			attrTypes.add(findDataType(attr));
		}
		System.out.println("Finish reading attributes");
		String[] colNames = new String[attrNames.size()];
		attrNames.toArray(colNames);
		DataType[] colTypes = new DataType[attrTypes.size()];
		attrTypes.toArray(colTypes);
		DataTableSpec outSpec = new DataTableSpec(tName, colNames, colTypes);
		return outSpec;
	}
static DataTableSpec createGlobalSpec ( XLog log ) { System . out . println ( "Begin reading attributes" ) ; String tName = XLog2TableConverterNodeModel . CFG_TABLE_NAME ; ; List < String > attrNames = new ArrayList ( ) ; List < DataType > attrTypes = new ArrayList ( ) ; List < XAttribute > traceAttrs = log . getGlobalTraceAttributes ( ) ; for ( XAttribute attr : traceAttrs ) { attrNames . add ( XLogSpecUtil . TRACE_ATTRIBUTE_PREFIX + attr . getKey ( ) ) ; attrTypes . add ( findDataType ( attr ) ) ; } List < XAttribute > eventAttrs = log . getGlobalEventAttributes ( ) ; for ( XAttribute attr : eventAttrs ) { attrNames . add ( XLogSpecUtil . EVENT_ATTRIBUTE_PREFIX + attr . getKey ( ) ) ; attrTypes . add ( findDataType ( attr ) ) ; } System . out . println ( "Finish reading attributes" ) ; String [ ] colNames = new String [ attrNames . size ( ) ] ; attrNames . toArray ( colNames ) ; DataType [ ] colTypes = new DataType [ attrTypes . size ( ) ] ; attrTypes . toArray ( colTypes ) ; DataTableSpec outSpec = new DataTableSpec ( tName , colNames , colTypes ) ; return outSpec ; }
we need to get all the attributes of an xlog
we need to get all the attributes of an xlog
// what if people partially store sth. in global attributes, sth not there?? // so we need to insist on the trace attribute, but don't forget the global attributes there // another thing if there are sth overlapping of event attributes and trace attributes // we need to have a test on it // after getting all the attributes, we creat name and types for them // DataTableSpec.createColumnSpecs(colNames, colTypes);