{"action":"created","issue":{"url":"https://api.github.com/repos/HEADS-project/sintefboard/issues/5","labels_url":"https://api.github.com/repos/HEADS-project/sintefboard/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/HEADS-project/sintefboard/issues/5/comments","events_url":"https://api.github.com/repos/HEADS-project/sintefboard/issues/5/events","html_url":"https://github.com/HEADS-project/sintefboard/issues/5","id":58559546,"number":5,"title":"findTypeDefinitionsByID() is not working as expected","user":{"login":"sdalgard","id":2270169,"avatar_url":"https://avatars.githubusercontent.com/u/2270169?v=3","gravatar_id":"","url":"https://api.github.com/users/sdalgard","html_url":"https://github.com/sdalgard","followers_url":"https://api.github.com/users/sdalgard/followers","following_url":"https://api.github.com/users/sdalgard/following{/other_user}","gists_url":"https://api.github.com/users/sdalgard/gists{/gist_id}","starred_url":"https://api.github.com/users/sdalgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdalgard/subscriptions","organizations_url":"https://api.github.com/users/sdalgard/orgs","repos_url":"https://api.github.com/users/sdalgard/repos","events_url":"https://api.github.com/users/sdalgard/events{/privacy}","received_events_url":"https://api.github.com/users/sdalgard/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"maxleiko","id":834945,"avatar_url":"https://avatars.githubusercontent.com/u/834945?v=3","gravatar_id":"","url":"https://api.github.com/users/maxleiko","html_url":"https://github.com/maxleiko","followers_url":"https://api.github.com/users/maxleiko/followers","following_url":"https://api.github.com/users/maxleiko/following{/other_user}","gists_url":"https://api.github.com/users/maxleiko/gists{/gist_id}","starred_url":"https://api.github.com/users/maxleiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxleiko/subscriptions","organizations_url":"https://api.github.com/users/maxleiko/orgs","repos_url":"https://api.github.com/users/maxleiko/repos","events_url":"https://api.github.com/users/maxleiko/events{/privacy}","received_events_url":"https://api.github.com/users/maxleiko/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-02-23T09:03:11Z","updated_at":"2015-02-23T10:33:49Z","closed_at":"2015-02-23T10:29:25Z","body":"The code in SerialInterpreter try to find typedefinitions but the call to .findTypeDefinitionsByID() return null. An alternative implementation using .getTypeDefinitions() in method   FindTypeDefinitionsByName() is working.\r\n\r\nIs this a bug in the method or is the registration of the typedefinition wrong?\r\n\r\n```java\r\n    private TypeDefinition FindTypeDefinitionsByName(String name) {\r\n        TypeDefinition ret = null;\r\n        for( TypeDefinition def :rx_root.findPackagesByID(\"sintef\").getTypeDefinitions()) {\r\n            if (def.getName().contentEquals(name)) {\r\n                ret = def;\r\n                System.err.println(\"FindTypeDefinitionsByName(\" + name + \") found <\" + def.getName() + \"> | <\" + def + \">\");\r\n                break;\r\n            }\r\n        }\r\n        return ret;\r\n    }\r\n    \r\n    synchronized private void ProcessLineIfTaskInstance(String data) {\r\n        if (data.startsWith(\"Task type=\") && data.contains(\"instance=\")) {\r\n            String[] s1 = data.replace(\"Task type=\", \"\").replace(\"instance=\", \"\").replace(\"state=\", \"\").split(\" \");\r\n            String tid = s1[0];\r\n            String iid = s1[1];\r\n            boolean started = s1[2].equals(\"RUN\");\r\n            TypeDefinition t = rx_root.findPackagesByID(\"sintef\").findTypeDefinitionsByID(tid);\r\n            TypeDefinition t2 = FindTypeDefinitionsByName(tid);\r\n            ComponentInstance instance = rx_root.findNodesByID(\"MySintefNode\").findComponentsByID(iid);\r\n            Log.info(\"{} Type def=\" + t);\r\n            Log.info(\"{} Type inst=\" + instance);\r\n\r\n            if (t == null) t = t2;\r\n            //FintAndPrintTypedef(\"Start of ProcessLineIfTaskInstance()\");\r\n\r\n            if (t == null) {\r\n                System.err.println(\"Task type <\" + tid + \"> not found ... creating\");\r\n                t = factory.createTypeDefinition();\r\n                t.setName(tid);\r\n\r\n                rx_root.findPackagesByID(\"sintef\").addTypeDefinitions(t);\r\n            }\r\n            if (instance == null) {\r\n                System.err.println(\"Task instance <\" + iid + \"> not found ... creating\");\r\n                instance = factory.createComponentInstance();\r\n```"},"comment":{"url":"https://api.github.com/repos/HEADS-project/sintefboard/issues/comments/75519904","html_url":"https://github.com/HEADS-project/sintefboard/issues/5#issuecomment-75519904","issue_url":"https://api.github.com/repos/HEADS-project/sintefboard/issues/5","id":75519904,"user":{"login":"maxleiko","id":834945,"avatar_url":"https://avatars.githubusercontent.com/u/834945?v=3","gravatar_id":"","url":"https://api.github.com/users/maxleiko","html_url":"https://github.com/maxleiko","followers_url":"https://api.github.com/users/maxleiko/followers","following_url":"https://api.github.com/users/maxleiko/following{/other_user}","gists_url":"https://api.github.com/users/maxleiko/gists{/gist_id}","starred_url":"https://api.github.com/users/maxleiko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxleiko/subscriptions","organizations_url":"https://api.github.com/users/maxleiko/orgs","repos_url":"https://api.github.com/users/maxleiko/repos","events_url":"https://api.github.com/users/maxleiko/events{/privacy}","received_events_url":"https://api.github.com/users/maxleiko/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T10:33:49Z","updated_at":"2015-02-23T10:33:49Z","body":"Yes agreed.\r\n\r\n@dukeboard Maybe KMF should not provide the `XXXByID()` method when IDs are composed keys  and replace the method by something like `XXXByYYYAndZZZ()`"}}