Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: emourot on March 08, 2016, 09:14:01 pm
-
Hello EA guys, I'm blocked for days and I would like assistance for the following issue. :o
I receive the following error when I try to create a tagged value on a package object...
OraOLEDB [-2147217900]
ORA-01400: cannot insert NULL into ("IB0040_ENT_ARCH_TEST"."T_OBJECTPROPERTIES"."PROPERTYID")
I'm using Visual Studio 2015 and I use the DLL provided via EA version 12 (the latest one).
When I inspect the content of the Element COM object, I see the TaggedValuesEx collection with 2 items.
When I try to add a 3rd one, the addItem() seems to work but the collection is not updated ?
Aftert that, when I try to call the Update() method, I received the error I described before.
Private Sub SetReqId(element As EA.Element, value As String)
Dim taggedValue As EA.TaggedValue = CType(element.TaggedValuesEx.GetByName("HPALM_ReqId"), EA.TaggedValue)
If taggedValue Is Nothing Then
Dim obj As Object = element.TaggedValuesEx.AddNew("HPALM_ReqId", "String")
taggedValue = CType(obj, EA.TaggedValue)
End If
taggedValue.Value = value
taggedValue.Update()
End Sub
Your help will be precious for me. :-[
I would like to avoid to access directly and dirtily to database.
Cheers.
Emmanuel @ Eurocontrol
-
I guess your value is null or nil. Try replacing it with a "" string.
q.
-
Dear Qwerty,
Unfortunately, the issue seems not coming from the Value attribute.
This is a screen capture of the taggedValue object and Value object before the error occurs.
(http://s16.postimg.org/l6zqgl2ch/Error_In_EAAutomation_Interface_2.jpg) (http://postimg.org/image/l6zqgl2ch/)
I'm wondering if the issue is not linked with a bug like this http://sparxsystems.com/forums/smf/index.php?topic=9739.0
(http://sparxsystems.com/forums/smf/index.php?topic=9739.0) ?
Thanls for your help.
Cheers.
Emmanuel @ Eurocontrol
PS : We bought all yours books and we really loved them.
-
I don't think you should be using the TaggedValuesEx collection.
Try to do the same with TaggedValues collection instead.
Geert
-
Honestly, the documentation is not clear about that. The Ex method is r/o as the no-Ex. Though I belief you are right.
Roy, this should be noted in the help.
I just tried the addNew with the Ex variant. Works without issue.
q.
P.S. The bug you linked is for V9. Which release is yours?
-
Hello ;D
I develop on a virtual machine with EA 12 (we plan to install EA 12 in Eurocontrol)
And my workstation has EA 10 installed, and my colleagues also.
For your information, my issue is the same with TaggedValue and TaggedValueEx collections.
As investigation, on yesterday, I used Oracle SQL Developer and tried to reproduce the Oracle error I got :
SQL Error: ORA-01400: cannot insert NULL into ("IB0040_ENT_ARCH_TEST"."T_OBJECTPROPERTIES"."PROPERTYID")
And I got exactly the same error with the following request :
INSERT INTO t_objectproperties (propertyid,object_id,property,value,notes,ea_guid)
VALUES ('',6408,'HPALM_ReqID',1,'','')
Two solutions :
- The PropertyID should be generated by EA and it is not. We've to do a bug report.
- The PropertyID is auto-generated and incremented by database. So in Oracle schema, this auto-numbering is disabled.
Quick and dirty solution (I need your opinion on it) :
Use a direct SQL statement on SQL database
INSERT INTO t_objectproperties
SELECT MAX(propertyid) +1,6408,'HPALM_ReqID',1,'',(GUID to be generated with EA)
FROM t_objectproperties
And execute it via the Repository.Execute( sql ); method
Cheers.
Emmanuel @ Eurocontrol
-
Emmanuel,
You should definitely check this with Sparx support.
They should be able to tell you if the ID field should be auto-increment or not.
You can also check the dberror.txt file in your %appdata%\Sparx Systems\EA folder.
That should contain the exact sql statement that triggered the error.
Geert
-
By checking the dberror.txt file I've read the following message :
08-03-2016 15:12:48
OraOLEDB [-2147217900]
ORA-01400: cannot insert NULL into ("IB0040_ENT_ARCH_TEST"."T_OBJECTPROPERTIES"."PROPERTYID")
Context:
Select * from t_objectproperties where PropertyID=0
Don't know its meaning...
I've also asked for an official Sparx Support.