I am using version 6.7.
Will highly appreciate help with setting Aspect Type properties of an object using DFS.
I have the following lines of code:
Aspect aspect = new Aspect("my_aspect_type_name");
dataObject.getAspects().add(aspect);
...
Then trying to set the object properties using "my_aspect_type_name.my_aspect_type_property_name"
...
dataPackage.addDataObject(dataObject);
dataPackage = objectService.create(dataPackage, ...);
At runtime, receiving the following error: unknown propertyName:my_aspect_type_name.my_aspect_type_property_name
When I ran this code without setting the properties, meaning only attaching the aspect, then after the object was successfully saved,
I did see the aspect properties on the object.
I have seen many examples with DFC,
and looks like a save on the object must be performed after attaching the aspect and before setting the aspect properties.
My questions:
1) Shall I perform a separate save after attaching an aspect in DFS in order to be able to update the aspect properties? Any way to avoid that?
2) Is it not recommended to perform such operations using DFS? Shall I do that using DFC?
Thanks!