Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method setStringAttributeAtIndex fails with Attribute is not of type 'single'. #1166

Closed
motjokk opened this issue Nov 6, 2020 · 5 comments
Closed

Comments

@motjokk
Copy link

motjokk commented Nov 6, 2020

On BIMserver 1.5.182

Using method setStringAttributeAtIndex of the LowLevelInterface.

{"request":{"interface":"LowLevelInterface","method":"setStringAttributeAtIndex","parameters":{"attributeName":"AddressLines","index":0,"oid":17762096,"tid":26,"value":"New Address"}}}


Error msg: UserException, Attribute is not of type 'single' when committing the transaction.

@hlg
Copy link
Member

hlg commented Nov 6, 2020

Indeed, the low level interface calls did not get much attention, both in development as well as in using and testing it. I think they deserve some general cleanup and testing. There will be more issues surfacing. I also think the interface is incomplete. Keep this open as a reminder.

Out of curiosity: What are you using the low level calls for?

@motjokk
Copy link
Author

motjokk commented Nov 6, 2020

I am trying to achieve full CRUD. So that attributes and the ifc schema can be alterd as needed by the end-user through a web-front end. From what I see, the LowLevelInterface is the only way to go about doing this today. As a user, I rather like the functions, as long as they work.

@motjokk
Copy link
Author

motjokk commented Nov 12, 2020

Hi @hlg again,

How is the interface working today, and how do you want to fix it? I have very little experience with Java development myself, but I might have a look at it.

@hlg
Copy link
Member

hlg commented Dec 21, 2020

I actually have an older fix for this particular issue in my fork (hlg@af26a57?w=1), which needs a merge here.

Currently the attribute changes are implemented in the classes SetAttributeChange, SetAttributeChangeAtIndex and SetWrappedAttributeChange which are instantiated in the implementation of LowLevelInterface, LowLevelServiceImpl. These contain some duplication and inconsistencies, probably from creation trough copy, paste and adjust. I would write some tests first and then refactor these classes.

The same may apply to other parts of the LowLevelInterface. I think it would be good to systematically go through all possible changes one may want to make and test whether it is possible with the current interface, ideally also writing unit tests. I thought I had a use case where I missed a call to set wrapped attributes at an index, but I can't find the note. I am not sure whether two-dimensional arrays are sufficiently covered or need adjustment.

It is great to see someone using the low level calls. You are very welcome to contribute if you still like to get your hands dirty with Java. Otherwise you help a lot if you just keep posting any other issues you encounter.

that attributes and the ifc schema can be alterd as needed by the end-user

Do you really want users to alter the schema through your webapp or do just you mean to alter the structure, that is to add and delete entities, going beyond just changing attribute values?

@motjokk
Copy link
Author

motjokk commented Dec 23, 2020

That sounds very good. The plan is to go beyond just changing values, and extend the schema. Consider the following example, where a IfcOccupant is added to a space.
Update with the more complete example:
image

I think I`ll stick to reporting issues, since this seems most productive.

Merry Christmas!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants