{"action":"opened","issue":{"url":"https://api.github.com/repos/node-opcua/node-opcua/issues/107","labels_url":"https://api.github.com/repos/node-opcua/node-opcua/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/node-opcua/node-opcua/issues/107/comments","events_url":"https://api.github.com/repos/node-opcua/node-opcua/issues/107/events","html_url":"https://github.com/node-opcua/node-opcua/issues/107","id":101910858,"number":107,"title":"Optional properties of custom ObjectTypes","user":{"login":"janschatz","id":13834416,"avatar_url":"https://avatars.githubusercontent.com/u/13834416?v=3","gravatar_id":"","url":"https://api.github.com/users/janschatz","html_url":"https://github.com/janschatz","followers_url":"https://api.github.com/users/janschatz/followers","following_url":"https://api.github.com/users/janschatz/following{/other_user}","gists_url":"https://api.github.com/users/janschatz/gists{/gist_id}","starred_url":"https://api.github.com/users/janschatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janschatz/subscriptions","organizations_url":"https://api.github.com/users/janschatz/orgs","repos_url":"https://api.github.com/users/janschatz/repos","events_url":"https://api.github.com/users/janschatz/events{/privacy}","received_events_url":"https://api.github.com/users/janschatz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-19T14:45:51Z","updated_at":"2015-08-19T14:45:51Z","closed_at":null,"body":"What is the correct way to deal with optional properties of custom ObjectTypes?\r\nI instance the ObjectType like this:\r\n```javascript\r\nvar MyType = address_space.findObjectType('MyType');\r\nvar myObject = MyType.instantiate({ organizedBy: parentNode, browseName: 'name' });\r\n```\r\nThen I check if I need certain optional properties and try to delete non-needed ones like this:\r\n```javascript\r\nvar prop = myObject.getPropertyByName('prop');\r\naddress_space.deleteObject(prop.nodeId);\r\n```\r\n\r\nThe function `deleteObject()` does not sound like deleting properties, but the source code looks like it is able to deal with several NodeClasses. So I gave it a try. However it does not remove HasProperty references from `myObject`. Should I remove these manually?"}}