コード例 #1
0
        XOrganizationalExtension() : base("Organizational", "org", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_RESOURCE = factory.CreateAttributeLiteral(KEY_RESOURCE, "__INVALID__", this);

            ATTR_ROLE = factory.CreateAttributeLiteral(KEY_ROLE, "__INVALID__", this);

            ATTR_GROUP = factory.CreateAttributeLiteral(KEY_GROUP, "__INVALID__", this);

            this.eventAttributes.Add(KEY_RESOURCE, (XAttribute)ATTR_RESOURCE.Clone());
            this.eventAttributes.Add(KEY_ROLE, (XAttribute)ATTR_ROLE.Clone());
            this.eventAttributes.Add(KEY_GROUP, (XAttribute)ATTR_GROUP.Clone());

            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_RESOURCE), "Resource");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_ROLE), "Role");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_GROUP), "Group");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_RESOURCE), "Akteur");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_ROLE), "Rolle");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_GROUP), "Gruppe");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_RESOURCE), "Agent");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_ROLE), "Rôle");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_GROUP), "Groupe");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_RESOURCE), "Recurso");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_ROLE), "Papel");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_GROUP), "Grupo");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_RESOURCE), "Recurso");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_ROLE), "Papel");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_GROUP), "Grupo");
        }
コード例 #2
0
        XTimeExtension() : base("Time", "time", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_TIMESTAMP = factory.CreateAttributeTimestamp(KEY_TIMESTAMP, 0L, this);

            this.eventAttributes.Add(KEY_TIMESTAMP, (XAttribute)ATTR_TIMESTAMP.Clone());

            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_TIMESTAMP), "Timestamp");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_TIMESTAMP), "Zeitstempel");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_TIMESTAMP), "Horodateur");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_TIMESTAMP), "Timestamp");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_TIMESTAMP), "Timestamp");
        }
コード例 #3
0
        XMicroExtension() : base("Micro", "micro", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_LENGTH = factory.CreateAttributeDiscrete(KEY_LENGTH, -1L, this);
            ATTR_PID    = factory.CreateAttributeID(KEY_PID, new XID(), this);
            ATTR_LEVEL  = factory.CreateAttributeDiscrete(KEY_LEVEL, -1L, this);

            this.eventAttributes.Add(KEY_PID, (XAttribute)ATTR_PID.Clone());
            this.eventAttributes.Add(KEY_LEVEL, (XAttribute)ATTR_LEVEL.Clone());
            this.eventAttributes.Add(KEY_LENGTH, (XAttribute)ATTR_LENGTH.Clone());

            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_PID), "Id of parent event of this event");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_LEVEL), "Micro level of this event");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_LENGTH), "Number of child events for this event");
        }
コード例 #4
0
ファイル: XIdentityExtension.cs プロジェクト: kroehne/LogFSM
        XIdentityExtension() : base("Identity", "identity", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_ID = factory.CreateAttributeID(KEY_ID, XIDFactory.Instance.CreateId(), this);

            this.logAttributes.Add(KEY_ID, (XAttribute)ATTR_ID.Clone());
            this.traceAttributes.Add(KEY_ID, (XAttribute)ATTR_ID.Clone());
            this.eventAttributes.Add(KEY_ID, (XAttribute)ATTR_ID.Clone());
            this.metaAttributes.Add(KEY_ID, (XAttribute)ATTR_ID.Clone());

            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_ID), "Identity");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_ID), "Identität");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_ID), "Identité");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_ID), "Identidad");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_ID), "Identidade");
        }
コード例 #5
0
        XSoftwareTelemetryExtension() : base("Software Telemetry", "swtelemetry", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_CPU_TOTAL_USER = factory.CreateAttributeDiscrete(KEY_CPU_TOTAL_USER, -1L, this);
            this.eventAttributes.Add(KEY_CPU_TOTAL_USER, (XAttribute)ATTR_CPU_TOTAL_USER.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CPU_TOTAL_USER), "CPU usage - total time in user space, in milliseconds");

            ATTR_CPU_TOTAL_KERNEL = factory.CreateAttributeDiscrete(KEY_CPU_TOTAL_KERNEL, -1L, this);
            this.eventAttributes.Add(KEY_CPU_TOTAL_KERNEL, (XAttribute)ATTR_CPU_TOTAL_KERNEL.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CPU_TOTAL_KERNEL), "CPU usage - total time in kernel space, in milliseconds");

            ATTR_CPU_TOTAL_IDLE = factory.CreateAttributeDiscrete(KEY_CPU_TOTAL_IDLE, -1L, this);
            this.eventAttributes.Add(KEY_CPU_TOTAL_IDLE, (XAttribute)ATTR_CPU_TOTAL_IDLE.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CPU_TOTAL_IDLE), "CPU usage - total time spent idle, in milliseconds");

            ATTR_CPU_LOAD_USER = factory.CreateAttributeContinuous(KEY_CPU_LOAD_USER, -1L, this);
            this.eventAttributes.Add(KEY_CPU_LOAD_USER, (XAttribute)ATTR_CPU_LOAD_USER.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CPU_LOAD_USER), "CPU usage - load in user space");

            ATTR_CPU_LOAD_KERNEL = factory.CreateAttributeContinuous(KEY_CPU_LOAD_KERNEL, -1L, this);
            this.eventAttributes.Add(KEY_CPU_LOAD_KERNEL, (XAttribute)ATTR_CPU_LOAD_KERNEL.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CPU_LOAD_KERNEL), "CPU usage - load in kernel space");

            ATTR_THREAD_TOTAL = factory.CreateAttributeDiscrete(KEY_THREAD_TOTAL, -1L, this);
            this.eventAttributes.Add(KEY_THREAD_TOTAL, (XAttribute)ATTR_THREAD_TOTAL.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_THREAD_TOTAL), "Total number of threads");

            ATTR_THREAD_DAEMON = factory.CreateAttributeDiscrete(KEY_THREAD_DAEMON, -1L, this);
            this.eventAttributes.Add(KEY_THREAD_DAEMON, (XAttribute)ATTR_THREAD_DAEMON.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_THREAD_DAEMON), "Number of daemon threads");

            ATTR_MEMORY_USED = factory.CreateAttributeDiscrete(KEY_MEMORY_USED, -1L, this);
            this.eventAttributes.Add(KEY_MEMORY_USED, (XAttribute)ATTR_MEMORY_USED.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_MEMORY_USED), "Total memory used, measured in bytes");


            ATTR_MEMORY_TOTAL = factory.CreateAttributeDiscrete(KEY_MEMORY_TOTAL, -1L, this);
            this.eventAttributes.Add(KEY_MEMORY_TOTAL, (XAttribute)ATTR_MEMORY_TOTAL.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_MEMORY_TOTAL), "Total memory available, measured in bytes");

            ATTR_MEMORY_LOAD = factory.CreateAttributeContinuous(KEY_MEMORY_LOAD, -1L, this);
            this.eventAttributes.Add(KEY_MEMORY_LOAD, (XAttribute)ATTR_MEMORY_LOAD.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_MEMORY_LOAD), "Memory usage load");
        }
コード例 #6
0
        XSoftwareCommunicationExtension() : base("Software Communication", "swcomm", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_LOCAL_HOST  = factory.CreateAttributeLiteral(KEY_LOCAL_HOST, "__INVALID__", this);
            ATTR_REMOTE_HOST = factory.CreateAttributeLiteral(KEY_REMOTE_HOST, "__INVALID__", this);
            ATTR_LOCAL_PORT  = factory.CreateAttributeDiscrete(KEY_LOCAL_PORT, -1L, this);
            ATTR_REMOTE_PORT = factory.CreateAttributeDiscrete(KEY_REMOTE_PORT, -1L, this);

            this.eventAttributes.Add(KEY_LOCAL_HOST, (XAttribute)ATTR_LOCAL_HOST.Clone());
            this.eventAttributes.Add(KEY_LOCAL_PORT, (XAttribute)ATTR_LOCAL_PORT.Clone());
            this.eventAttributes.Add(KEY_REMOTE_HOST, (XAttribute)ATTR_REMOTE_HOST.Clone());
            this.eventAttributes.Add(KEY_REMOTE_PORT, (XAttribute)ATTR_REMOTE_PORT.Clone());


            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_LOCAL_HOST), "Local endpoint - host name");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_LOCAL_PORT), "Local endpoint - port");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_REMOTE_HOST), "Remote endpoint - host name");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_REMOTE_PORT), "Remote endpoint - port");
        }
コード例 #7
0
ファイル: XSemanticExtension.cs プロジェクト: kroehne/LogFSM
        XSemanticExtension() : base("Semantic", "semantic", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_MODELREFERENCE = factory.CreateAttributeLiteral(KEY_MODELREFERENCE, "__INVALID__", this);

            this.logAttributes.Add(KEY_MODELREFERENCE, (XAttribute)ATTR_MODELREFERENCE.Clone());
            this.traceAttributes.Add(KEY_MODELREFERENCE, (XAttribute)ATTR_MODELREFERENCE.Clone());
            this.eventAttributes.Add(KEY_MODELREFERENCE, (XAttribute)ATTR_MODELREFERENCE.Clone());
            this.metaAttributes.Add(KEY_MODELREFERENCE, (XAttribute)ATTR_MODELREFERENCE.Clone());

            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_MODELREFERENCE), "Ontology Model Reference");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_MODELREFERENCE), "Ontologie-Modellreferenz");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_MODELREFERENCE),
                                                             "Référence au Modèle Ontologique");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_MODELREFERENCE),
                                                             "Referencia de Modelo Ontológico");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_MODELREFERENCE),
                                                             "Referência de Modelo Ontológico");
        }
コード例 #8
0
ファイル: XLifecycleExtension.cs プロジェクト: kroehne/LogFSM
        XLifecycleExtension() : base("Lifecycle", "lifecycle", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_MODEL      = factory.CreateAttributeLiteral(KEY_MODEL, "standard", this);
            ATTR_TRANSITION = factory.CreateAttributeLiteral(KEY_TRANSITION, StandardModel.COMPLETE.ToString(),
                                                             this);

            this.logAttributes.Add(KEY_MODEL, (XAttributeLiteral)ATTR_MODEL.Clone());
            this.eventAttributes.Add(KEY_TRANSITION, (XAttributeLiteral)ATTR_TRANSITION.Clone());

            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_MODEL), "Lifecycle Model");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_TRANSITION), "Lifecycle Transition");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_MODEL), "Lebenszyklus-Model");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_TRANSITION), "Lebenszyklus-Transition");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_MODEL), "Modèle du Cycle Vital");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_TRANSITION), "Transition en Cycle Vital");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_MODEL), "Modelo de Ciclo de Vida");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_TRANSITION), "Transición en Ciclo de Vida");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_MODEL), "Modelo do Ciclo de Vida");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_TRANSITION), "Transição do Ciclo de Vida");
        }
コード例 #9
0
ファイル: XConceptExtension.cs プロジェクト: kroehne/LogFSM
        XConceptExtension() : base("Concept", "concept", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_NAME     = factory.CreateAttributeLiteral(KEY_NAME, "__INVALID__", this);
            ATTR_INSTANCE = factory.CreateAttributeLiteral(KEY_INSTANCE, "__INVALID__", this);

            this.logAttributes.Add(KEY_NAME, (XAttribute)ATTR_NAME.Clone());
            this.traceAttributes.Add(KEY_NAME, (XAttribute)ATTR_NAME.Clone());
            this.eventAttributes.Add(KEY_NAME, (XAttribute)ATTR_NAME.Clone());
            this.eventAttributes.Add(KEY_INSTANCE, (XAttribute)ATTR_INSTANCE.Clone());

            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_NAME), "Name");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_INSTANCE), "Instance");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_NAME), "Name");
            XGlobalAttributeNameMap.Instance.RegisterMapping("DE", QualifiedName(KEY_INSTANCE), "Instanz");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_NAME), "Appellation");
            XGlobalAttributeNameMap.Instance.RegisterMapping("FR", QualifiedName(KEY_INSTANCE), "Entité");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_NAME), "Nombre");
            XGlobalAttributeNameMap.Instance.RegisterMapping("ES", QualifiedName(KEY_INSTANCE), "Instancia");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_NAME), "Nome");
            XGlobalAttributeNameMap.Instance.RegisterMapping("PT", QualifiedName(KEY_INSTANCE), "Instância");
        }
コード例 #10
0
ファイル: XCostExtension.cs プロジェクト: kroehne/LogFSM
        XCostExtension() : base("Cost", "cost", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            ATTR_TOTAL    = factory.CreateAttributeContinuous(KEY_TOTAL, 0.0D, this);
            ATTR_CURRENCY = factory.CreateAttributeLiteral(KEY_CURRENCY, "__INVALID__", this);
            ATTR_AMOUNT   = factory.CreateAttributeContinuous(KEY_AMOUNT, 0.0D, this);
            ATTR_DRIVER   = factory.CreateAttributeLiteral(KEY_DRIVER, "__INVALID__", this);
            ATTR_TYPE     = factory.CreateAttributeLiteral(KEY_TYPE, "__INVALID__", this);

            this.traceAttributes.Add(KEY_TOTAL, (XAttribute)ATTR_TOTAL.Clone());
            this.traceAttributes.Add(KEY_CURRENCY, (XAttribute)ATTR_CURRENCY.Clone());
            this.eventAttributes.Add(KEY_TOTAL, (XAttribute)ATTR_TOTAL.Clone());
            this.eventAttributes.Add(KEY_CURRENCY, (XAttribute)ATTR_CURRENCY.Clone());
            this.eventAttributes.Add(KEY_AMOUNT, (XAttribute)ATTR_AMOUNT.Clone());
            this.eventAttributes.Add(KEY_DRIVER, (XAttribute)ATTR_DRIVER.Clone());
            this.eventAttributes.Add(KEY_TYPE, (XAttribute)ATTR_TYPE.Clone());

            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_TOTAL), "Total Cost");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CURRENCY), "Currency of Cost");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_AMOUNT), "Cost Amount");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_DRIVER), "Cost Driver");
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_TYPE), "Cost Type");
        }
コード例 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:OpenXesNet.in.XesXmlGzipParser"/> class.
 /// </summary>
 /// <param name="factory">The XES model factory instance used to build the
 /// model from the serialization.</param>
 public XesXmlGzipParser(IXFactory factory) : base(factory)
 {
 }
コード例 #12
0
 public D(IXFactory xFactory)
 {
     XFactory = xFactory;
 }
コード例 #13
0
ファイル: XExtensionParser.cs プロジェクト: kroehne/LogFSM
        protected XExtension Parse(XmlReader reader)
        {
            XExtension extension        = null;
            XAttribute currentAttribute = null;
            Dictionary <string, XAttribute> xAttributes = null;
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            while (reader.Read())
            {
                // When a start tag is found
                if (reader.IsStartElement())
                {
                    string tagName = reader.LocalName;
                    if (tagName.Equals("", StringComparison.CurrentCultureIgnoreCase))
                    {
                        tagName = reader.Name;
                    }

                    if (tagName.Equals("xesextension", StringComparison.CurrentCultureIgnoreCase))
                    {
                        string xName   = reader.GetAttribute("name");
                        string xPrefix = reader.GetAttribute("prefix");
                        Uri    xUri    = null;
                        try
                        {
                            xUri = new Uri(reader.GetAttribute("uri"));
                        }
                        catch (UriFormatException e)
                        {
                            XLogging.Log(e.Message, XLogging.Importance.ERROR);
                            throw e;
                        }
                        extension = new XExtension(xName, xPrefix, xUri);
                    }
                    else if (tagName.Equals("log", StringComparison.CurrentCultureIgnoreCase))
                    {
                        xAttributes = extension.LogAttributes;
                    }
                    else if (tagName.Equals("trace", StringComparison.CurrentCultureIgnoreCase))
                    {
                        xAttributes = extension.TraceAttributes;
                    }
                    else if (tagName.Equals("event", StringComparison.CurrentCultureIgnoreCase))
                    {
                        xAttributes = extension.EventAttributes;
                    }
                    else if (tagName.Equals("meta", StringComparison.CurrentCultureIgnoreCase))
                    {
                        xAttributes = extension.MetaAttributes;
                    }
                    else if (tagName.Equals("string", StringComparison.CurrentCultureIgnoreCase))
                    {
                        string key = reader.GetAttribute("key");
                        currentAttribute = factory.CreateAttributeLiteral(key, "DEFAULT", extension);
                        xAttributes.Add(key, currentAttribute);
                    }
                    else if (tagName.Equals("date", StringComparison.CurrentCultureIgnoreCase))
                    {
                        string key = reader.GetAttribute("key");
                        currentAttribute = factory.CreateAttributeTimestamp(key, 0L, extension);
                        xAttributes.Add(key, currentAttribute);
                    }
                    else if (tagName.Equals("int", StringComparison.CurrentCultureIgnoreCase))
                    {
                        string key = reader.GetAttribute("key");
                        currentAttribute = factory.CreateAttributeDiscrete(key, 0L, extension);
                        xAttributes.Add(key, currentAttribute);
                    }
                    else if (tagName.Equals("float", StringComparison.CurrentCultureIgnoreCase))
                    {
                        string key = reader.GetAttribute("key");
                        currentAttribute = factory.CreateAttributeContinuous(key, 0.0D, extension);
                        xAttributes.Add(key, currentAttribute);
                    }
                    else if (tagName.Equals("boolean", StringComparison.CurrentCultureIgnoreCase))
                    {
                        string key = reader.GetAttribute("key");
                        currentAttribute = factory.CreateAttributeBoolean(key, false, extension);
                        xAttributes.Add(key, currentAttribute);
                    }
                    else if (tagName.Equals("id", StringComparison.CurrentCultureIgnoreCase))
                    {
                        string key = reader.GetAttribute("key");
                        currentAttribute = factory.CreateAttributeID(key, XIDFactory.Instance.CreateId(),
                                                                     extension);
                        xAttributes.Add(key, currentAttribute);
                    }
                    else if (tagName.Equals("alias", StringComparison.CurrentCultureIgnoreCase) && currentAttribute != null)
                    {
                        string mapping = reader.GetAttribute("mapping");
                        string name    = reader.GetAttribute("name");
                        XGlobalAttributeNameMap.Instance.RegisterMapping(mapping, currentAttribute.Key, name);
                    }
                    else
                    {
                        // non supported tag
                        XLogging.Log(String.Format("Non-supported tag '{0}' found. Ignoring it.", tagName), XLogging.Importance.TRACE);
                    }
                }
                // When a close tag is found (including empty elements)
                if (reader.IsEmptyElement || !reader.IsStartElement())
                {
                    string tagName = reader.LocalName;
                    if (tagName.Equals("", StringComparison.InvariantCultureIgnoreCase))
                    {
                        tagName = reader.Name;
                    }
                    if (ATTRIBUTE_TYPES.Contains(tagName.Trim().ToLower()))
                    {
                        currentAttribute = null;
                    }
                }
            }
            return(extension);
        }
コード例 #14
0
        XSoftwareEventExtension() : base("Software  evt", "swevent", EXTENSION_URI)
        {
            IXFactory factory = XFactoryRegistry.Instance.CurrentDefault;

            #region Application Information
            ATTR_APP_NAME = factory.CreateAttributeLiteral(KEY_APP_NAME, "__INVALID__", this);
            this.eventAttributes.Add(KEY_APP_NAME, (XAttribute)ATTR_APP_NAME.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_APP_NAME), "User defined application name");

            ATTR_APP_NODE = factory.CreateAttributeLiteral(KEY_APP_NODE, "__INVALID__", this);
            this.eventAttributes.Add(KEY_APP_NODE, (XAttribute)ATTR_APP_NODE.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_APP_NODE), "User defined application node");

            ATTR_APP_SESSION = factory.CreateAttributeLiteral(KEY_APP_SESSION, "__INVALID__", this);
            this.eventAttributes.Add(KEY_APP_SESSION, (XAttribute)ATTR_APP_SESSION.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_APP_SESSION), "User defined application session");

            ATTR_APP_TIER = factory.CreateAttributeLiteral(KEY_APP_TIER, "__INVALID__", this);
            this.eventAttributes.Add(KEY_APP_TIER, (XAttribute)ATTR_APP_TIER.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_APP_TIER), "User defined application tier");
            #endregion

            #region Callee event location
            ATTR_CALLEE_PACKAGE = factory.CreateAttributeLiteral(KEY_CALLEE_PACKAGE, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLEE_PACKAGE, (XAttribute)ATTR_CALLEE_PACKAGE.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLEE_PACKAGE), "Callee - Package");

            ATTR_CALLEE_CLASS = factory.CreateAttributeLiteral(KEY_CALLEE_CLASS, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLEE_CLASS, (XAttribute)ATTR_CALLEE_CLASS.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLEE_CLASS), "Callee - Class");

            ATTR_CALLEE_METHOD = factory.CreateAttributeLiteral(KEY_CALLEE_METHOD, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLEE_METHOD, (XAttribute)ATTR_CALLEE_METHOD.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLEE_METHOD), "Callee - Method");

            ATTR_CALLEE_PARAMSIG = factory.CreateAttributeLiteral(KEY_CALLEE_PARAMSIG, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLEE_PARAMSIG, (XAttribute)ATTR_CALLEE_PARAMSIG.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLEE_PARAMSIG), "Callee - Parameter signature");

            ATTR_CALLEE_RETURNSIG = factory.CreateAttributeLiteral(KEY_CALLEE_RETURNSIG, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLEE_RETURNSIG, (XAttribute)ATTR_CALLEE_RETURNSIG.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLEE_RETURNSIG), "Callee - Return signature");

            ATTR_CALLEE_ISCONSTRUCTOR = factory.CreateAttributeBoolean(KEY_CALLEE_ISCONSTRUCTOR, false, this);
            this.eventAttributes.Add(KEY_CALLEE_ISCONSTRUCTOR, (XAttribute)ATTR_CALLEE_ISCONSTRUCTOR.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLEE_ISCONSTRUCTOR), "Callee - Is a class constructor");

            ATTR_CALLEE_INSTANCEID = factory.CreateAttributeLiteral(KEY_CALLEE_INSTANCEID, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLEE_INSTANCEID, (XAttribute)ATTR_CALLEE_INSTANCEID.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_INSTANCEID), "Callee - Instance id of class instance");

            ATTR_CALLEE_FILENAME = factory.CreateAttributeLiteral(KEY_CALLEE_FILENAME, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLEE_FILENAME, (XAttribute)ATTR_CALLEE_FILENAME.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLEE_FILENAME), "Callee - File name source code artifact");

            ATTR_CALLEE_LINENR = factory.CreateAttributeDiscrete(KEY_CALLEE_LINENR, -1L, this);
            this.eventAttributes.Add(KEY_CALLEE_LINENR, (XAttribute)ATTR_CALLEE_LINENR.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLEE_LINENR), "Callee - Line number is source code artifact");
            #endregion

            #region Caller event Location
            ATTR_CALLER_PACKAGE = factory.CreateAttributeLiteral(KEY_CALLER_PACKAGE, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLER_PACKAGE, (XAttribute)ATTR_CALLER_PACKAGE.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_PACKAGE), "Caller - Package");

            ATTR_CALLER_CLASS = factory.CreateAttributeLiteral(KEY_CALLER_CLASS, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLER_CLASS, (XAttribute)ATTR_CALLER_CLASS.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_CLASS), "Caller - Class");

            ATTR_CALLER_METHOD = factory.CreateAttributeLiteral(KEY_CALLER_METHOD, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLER_METHOD, (XAttribute)ATTR_CALLER_METHOD.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_METHOD), "Caller - Method");

            ATTR_CALLER_PARAMSIG = factory.CreateAttributeLiteral(KEY_CALLER_PARAMSIG, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLER_PARAMSIG, (XAttribute)ATTR_CALLER_PARAMSIG.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_PARAMSIG), "Caller - Parameter signature");

            ATTR_CALLER_RETURNSIG = factory.CreateAttributeLiteral(KEY_CALLER_RETURNSIG, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLER_RETURNSIG, (XAttribute)ATTR_CALLER_RETURNSIG.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_RETURNSIG), "Caller - Return signature");

            ATTR_CALLER_ISCONSTRUCTOR = factory.CreateAttributeBoolean(KEY_CALLER_ISCONSTRUCTOR, false, this);
            this.eventAttributes.Add(KEY_CALLER_ISCONSTRUCTOR, (XAttribute)ATTR_CALLER_ISCONSTRUCTOR.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_ISCONSTRUCTOR), "Caller - Is a class constructor");

            ATTR_CALLER_INSTANCEID = factory.CreateAttributeLiteral(KEY_CALLER_INSTANCEID, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLER_INSTANCEID, (XAttribute)ATTR_CALLER_INSTANCEID.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_INSTANCEID), "Caller - Instance id of class instance");

            ATTR_CALLER_FILENAME = factory.CreateAttributeLiteral(KEY_CALLER_FILENAME, "__INVALID__", this);
            this.eventAttributes.Add(KEY_CALLER_FILENAME, (XAttribute)ATTR_CALLER_FILENAME.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_FILENAME), "Caller - File name source code artifact");

            ATTR_CALLER_LINENR = factory.CreateAttributeDiscrete(KEY_CALLER_LINENR, -1L, this);
            this.eventAttributes.Add(KEY_CALLER_LINENR, (XAttribute)ATTR_CALLER_LINENR.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_CALLER_LINENR), "Caller - Line number is source code artifact");
            #endregion

            #region Exception Information
            ATTR_HAS_EXCEPTION = factory.CreateAttributeBoolean(KEY_HAS_EXCEPTION, false, this);
            this.logAttributes.Add(KEY_HAS_EXCEPTION, (XAttribute)ATTR_HAS_EXCEPTION.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_HAS_EXCEPTION), "Has exception data");

            ATTR_EX_CAUGHT = factory.CreateAttributeLiteral(KEY_EX_CAUGHT, "__INVALID__", this);
            this.eventAttributes.Add(KEY_EX_CAUGHT, (XAttribute)ATTR_EX_CAUGHT.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_EX_CAUGHT), "Caught exception type");

            ATTR_EX_THROWN = factory.CreateAttributeLiteral(KEY_EX_THROWN, "__INVALID__", this);
            this.eventAttributes.Add(KEY_EX_THROWN, (XAttribute)ATTR_EX_THROWN.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_EX_THROWN), "Thrown exception type");
            #endregion

            #region Runtime Information
            ATTR_NANOTIME = factory.CreateAttributeDiscrete(KEY_NANOTIME, -1L, this);
            this.eventAttributes.Add(KEY_NANOTIME, (XAttribute)ATTR_NANOTIME.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_NANOTIME), "Elapsed nanotime");

            ATTR_THREAD_ID = factory.CreateAttributeLiteral(KEY_THREAD_ID, "__INVALID__", this);
            this.eventAttributes.Add(KEY_THREAD_ID, (XAttribute)ATTR_THREAD_ID.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_THREAD_ID), "Thread id for generated event");
            #endregion

            #region Method Data
            ATTR_HAS_DATA = factory.CreateAttributeBoolean(KEY_HAS_DATA, false, this);
            this.logAttributes.Add(KEY_HAS_DATA, (XAttribute)ATTR_HAS_DATA.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_HAS_DATA), "Has method data");

            ATTR_RETURN_VALUE = factory.CreateAttributeLiteral(KEY_RETURN_VALUE, "__INVALID__", this);
            this.eventAttributes.Add(KEY_RETURN_VALUE, (XAttribute)ATTR_RETURN_VALUE.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_RETURN_VALUE), "Return value for the returning method");

            ATTR_PARAMS = factory.CreateAttributeList(KEY_PARAMS, this);
            this.eventAttributes.Add(KEY_PARAMS, (XAttribute)ATTR_PARAMS.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_PARAMS), "List of parameters for the called method");

            ATTR_PARAM_VALUE = factory.CreateAttributeLiteral(KEY_PARAM_VALUE, "__INVALID__", this);
            this.metaAttributes.Add(KEY_PARAM_VALUE, (XAttribute)ATTR_PARAM_VALUE.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_PARAM_VALUE), "A parameter value in the list params");

            ATTR_VALUE_TYPE = factory.CreateAttributeLiteral(KEY_VALUE_TYPE, "__INVALID__", this);
            this.metaAttributes.Add(KEY_VALUE_TYPE, (XAttribute)ATTR_VALUE_TYPE.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_VALUE_TYPE), "A runtime value type for a return or parameter value");
            #endregion

            #region Event type and lifecycle
            ATTR_TYPE = factory.CreateAttributeLiteral(KEY_TYPE, "__INVALID__", this);
            this.eventAttributes.Add(KEY_TYPE, (XAttribute)ATTR_TYPE.Clone());
            XGlobalAttributeNameMap.Instance.RegisterMapping("EN", QualifiedName(KEY_TYPE), "Event type");
            #endregion
        }
コード例 #15
0
ファイル: XesXmlParser.cs プロジェクト: kroehne/LogFSM
 /// <summary>
 /// Creates a new parser instance.
 /// </summary>
 /// <param name="factory">The XES model factory instance used to build
 /// the model from the serialization.</param>
 public XesXmlParser(IXFactory factory)
 {
     this.factory = factory;
 }
コード例 #16
-1
ファイル: XAttributeUtils.cs プロジェクト: kroehne/LogFSM
        /// <summary>
        /// Composes the appropriate attribute type from the string-based information
        /// found, e.g., in XML serializations.
        /// </summary>
        /// <returns>An appropriate attribute.</returns>
        /// <param name="factory">Factory to use for creating the attribute.</param>
        /// <param name="key">Key of the attribute.</param>
        /// <param name="value">Value of the attribute.</param>
        /// <param name="type">Type string of the attribute.</param>
        /// <param name="extension">Extension of the attribute (can be <code>null</code>).</param>
        public static XAttribute ComposeAttribute(IXFactory factory, string key, string value, string type,
                                                  XExtension extension)
        {
            type = type.Trim();
            if (type.Equals("LIST", StringComparison.CurrentCultureIgnoreCase))
            {
                XAttributeList attr = factory.CreateAttributeList(key, extension);
                return(attr);
            }
            if (type.Equals("CONTAINER", StringComparison.CurrentCultureIgnoreCase))
            {
                XAttributeContainer attr = factory.CreateAttributeContainer(key, extension);
                return(attr);
            }
            if (type.Equals("LITERAL", StringComparison.CurrentCultureIgnoreCase))
            {
                XAttributeLiteral attr = factory.CreateAttributeLiteral(key, value, extension);

                return(attr);
            }
            if (type.Equals("BOOLEAN", StringComparison.CurrentCultureIgnoreCase))
            {
                XAttributeBoolean attr = factory.CreateAttributeBoolean(key, bool.Parse(value), extension);

                return(attr);
            }
            if (type.Equals("CONTINUOUS", StringComparison.CurrentCultureIgnoreCase))
            {
                XAttributeContinuous attr = factory.CreateAttributeContinuous(key, double.Parse(value), extension);

                return(attr);
            }
            if (type.Equals("DISCRETE", StringComparison.CurrentCultureIgnoreCase))
            {
                XAttributeDiscrete attr = factory.CreateAttributeDiscrete(key, long.Parse(value), extension);

                return(attr);
            }
            if (type.Equals("TIMESTAMP", StringComparison.CurrentCultureIgnoreCase))
            {
                IXAttributeTimestamp attr;
                try
                {
                    attr = factory.CreateAttributeTimestamp(key, DateTime.Parse(value), extension);
                }
                catch (FormatException)
                {
                    throw new InvalidOperationException("OpenXES: could not parse date-time attribute. Value: " + value);
                }

                return((XAttributeTimestamp)attr);
            }
            if (type.Equals("ID", StringComparison.CurrentCultureIgnoreCase))
            {
                XAttributeID attr = factory.CreateAttributeID(key, XID.Parse(value), extension);
                return(attr);
            }
            throw new InvalidOperationException("OpenXES: could not parse attribute type!");
        }