question-circle PropertyTable default values are not enforced

3 years 7 months ago #5433 by craae
Default values defined for properties in PropertyTables (assigned to Archimate MetaclassReferenced) are not enforced when new ArchiMate element instances are created.

I have just realized that through a query there properties with default values were assigned. (All the default values are not preset as expected). How do I enforce such a preset of those default values?

# Test

print "Model"
Model = Modelio.getInstance().getModelingSession().getModel()
print Model
print "Roots (LibraryRoots): "
print Model.getLibraryRoots()
print "Roots (ModelRoots):"
print Model.getModelRoots()

modelingSession = Modelio.getInstance().getModelingSession()
print "Metamodel Extensions:"
print modelingSession.getMetamodelExtensions()

print modelingSession.getRequirementModel()
BPCollection  = Modelio.getInstance().getModelingSession().findByClass(BusinessProcess)
print BPCollection

for element in BPCollection:
	print element
	print element.getName()
	for prop in element.getProperties():
		print prop.getName()
		print prop
		print prop.getContent()

Please Log in or Create an account to join the conversation.

3 years 5 months ago #5538 by ebr
Hi Craae,

Could you describe a little bit more your usecase more precisely why and when do you want to preset these properties!?

If you want to check the values of these properties, it is possible to return the default values if nothing is found so you do not have to "preset" the values.


Please Log in or Create an account to join the conversation.

Moderators: chmcma
Time to create page: 0.036 seconds
^ Back to Top