Author Topic: «ArcGIS» Workspace Model and tagged values  (Read 5891 times)

Wolf K

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
«ArcGIS» Workspace Model and tagged values
« on: June 06, 2014, 10:40:06 am »
I created an «ArcGIS» Workspace model from scratch (using the ArcGIS workspace extension/ pattern).  My model is quite extensive and now I realize that EA left virtually all 'tagged values' for attribute columns empty.  Examples are "IsNullable" or "Length" etc.  Needless to say the export to Workspace XML is rattled with errors.  My model has probably about 100 feature classes and tables.  The user interface to enter tagged values is what I consider somewhat "user hostile" meaning that if I have to enter these tags manually it will take me months.  Is there an automated way to do populate these tags (at least with default values?)
I am not sure which errors are show stoppers but when I run the validation script I get an error on line 1702
ArcGIS™.ValidateArcGISModel error: Overflow: 'CInt', Line:1702      
If CInt(length) > MAX_TEXT_LENGTH Or CInt(length) < MIN_TEXT_LENGTH Then
Anyways I am somehow getting the impression that this extension doesn't get too much use.   Has anybody used this extension before and successfully produced an XML model?  

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: «ArcGIS» Workspace Model and tagged values
« Reply #1 on: June 06, 2014, 10:44:41 pm »
Hi,

Quote
I created an «ArcGIS» Workspace model from scratch (using the ArcGIS workspace extension/ pattern).  My model is quite extensive and now I realize that EA left virtually all 'tagged values' for attribute columns empty. Examples are "IsNullable" or "Length" etc.
Many of the ArcGIS tags for fields have a default value. For example IsNullable is a boolean value, set to true by default. Even though length has an empty/0 value by default, the exporter will insert the valid ArcGIS default of 50. You get a warning for that, which you can ignore if you're content with 50. Otherwise you should specify a valid length value for your fields.

If you actually see an empty value for say IsNullable, please let us know which version of Enterprise Architect you are using. It would also be worth sending a note to Sparx support so they can investigate further.

Quote
The user interface to enter tagged values is what I consider somewhat "user hostile" meaning that if I have to enter these tags manually it will take me months.
There are two interfaces for editing tags. I find the dockable view handy (Main Menu | View | Tagged Values). It refreshes as you select another element or field (UML attribute). It can be handy if you need to edit a specific tag for numerous elements or attribtues - especially when the values for that tag vary per element/attribute.

Quote
Is there an automated way to do populate these tags (at least with default values?)
Yes you can automatically populate tagged values. A Model Script is probably the easiest/safest way. But if it is just to insert default values for the ArcGIS profile tags, you should not need to bother.

Quote
I am not sure which errors are show stoppers but when I run the validation script I get an error on line 1702
ArcGIS™.ValidateArcGISModel error: Overflow: 'CInt', Line:1702      
If CInt(length) > MAX_TEXT_LENGTH Or CInt(length) < MIN_TEXT_LENGTH Then
Here the validation script should definitely be improved by using CLng instead of CInt. I guess you inserted a length value greater than 32,767 and CInt blows a fuse over that. We'll get that corrected forthwith.

Now the script was in the process of reporting a warning. From memory, only file geodatabases allow you to have string lengths greater than 255 characters. So a schema with string fields above that limit probably won't work if implemented on other types of geodatabase. If you're ok with that and really want string fields wider than 32,767 characters, you can stop the validation script from complaining:

At line 1702, change CInt to CLng in both places (you could probably even do a global search/replace for this throughout the script)
At line 147, change MAX_TEXT_LENGTH from 255 to whatever limit you like.

You can get the script code here, along with instructions on how to import it into Enterprise Architect (so as to workaround the issue with the built-in script):
http://www.sparxsystems.com/arcgis/model-validation.html

This is also where we will first post the updated script before it gets rolled into an Enterprise Architect release to update the built-in script.

Quote
Anyways I am somehow getting the impression that this extension doesn't get too much use.   Has anybody used this extension before and successfully produced an XML model?
Apart from myself, I know others outside of Sparx that generate ArcGIS XML Workspace documents and import them to ArcCatalog successfully. It gets a fair thrashing along the way, but we obviously haven't used strings wider than 32K yet. As with other types of automated schema generation, there is some set up and model config involved. So there's a learning curve, but hopefully not too steep.

I hope this helps.

Ben

Wolf K

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: «ArcGIS» Workspace Model and tagged values
« Reply #2 on: June 07, 2014, 02:56:13 am »
Thanks much, this helped a lot.  I actually exported the XMI and edited the XMI in visual studio in order to get most of my default tags set.  This seemed to have worked.  I will do the same with the max. string length now.  
Thanks again, this was very helpful.

Wolf K

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: «ArcGIS» Workspace Model and tagged values
« Reply #3 on: June 10, 2014, 07:12:14 am »
Just to sum up my experience on using EA to design a Geodatabase: It clearly is not the way to go.  After spending hours editing my model in workspace XML form in order to 'mass' edit items for which the validation complained, I tried to 'import my model using ArcCatalog'.  I am now getting error messages on import like "Import failed" or "Field is not nullable" with no explanation of the error or the source table/attribute.
In Sum: unless you have unlimited funding on your project don't go this route.  

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: «ArcGIS» Workspace Model and tagged values
« Reply #4 on: June 13, 2014, 03:03:39 pm »
Hi Wolf,

Sorry to hear you had troubles getting this to work.

I am curious about the XML editing you did though. Was it actually the XMI you edited or the generated ArcGIS XML Workspace document? They are quite different things.

If the latter, after editing that autogenerated XML Workspace file you still would have the old values left in your original EA model. So upon discovering issues when importing the workspace document into ArcCatalog, you wouldn't be able to simply tweak the original model and regenerate. (Not without first making the same tagged value changes in the original model of course). I do agree that the XML workspace import errors can be too vague, which is why we programmed so many checks and warnings into the model validation script.

On the other hand, if you actually did export and edit the XMI file from EA (that is a file with complete model info, not the ArcGIS XML workspace document), you could reimport the edited XMI file back into an EA project. Then rerun the model validator and address any remaining warnings/errors to get the ArcCatalog import to succeed. I hadn't really considered this search-and-replace strategy using XMI at first, but it is a possible approach for others that wanted to do such an update on tags and not use a Model Script.

As for the model validation script, the code changes I mentioned have been included in the updated script linked from here:
http://www.sparxsystems.com/arcgis/model-validation.html

So the model validator will more gracefully complain about very wide strings now. The same updates will be rolled into a subsequent Enterprise Architect release.

Thanks for posting your feedback.

Ben

PS: In case you haven't seen it yet, there is a introductory tutorial/webinar available here, with an example model and generated schema available for download:
http://sparxsystems.com/resources/demos/geospatial/how-to-design-a-geodatabase.html