Hi all I'm using Ivy 6.3 and use ivy.repo api to persist data. When i persits data as this JSON:
The api say:
My object QualificationMessageResult has list of Object A, and object A has two properties: a object descriptor and a list of Object A (looped Object) with name: paramDescriptors. Can anyone suggest me something? Thanks asked 03.05.2017 at 09:41 trungdv SupportIvyTeam ♦♦ |
You do not run into this problem if you just introduce a new attribute for the new type instead of re-using the existing attribute that already contains other data. Business Data is explicitly designed to allow simple data migration. So it does not throw any errors for unknown fields. However, there is a work around If you just wrapped the String in a complex object you could work around the problem by influencing the JSON serialization. With Jackson you could for instance store the new complex object also as string and read it back to a complex object. And of course this also allows you to handle legacy serialized objects. The rough concept is described here: http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.datamodeling.html#ivy.businessdata.serialization.module A sample implementation could do the following. Here we serialize a complex Person object as a raw String. FIRST: Write your own serializer module:
SECOND: register it via service SPI: Here you see the custom serializer in action: answered 04.07.2017 at 08:29 Reguel Werme... ♦♦ Alex Suter ♦♦ This demo is just for illustrative purposes. In a real world scenario you should pay special care that the serializer / deserializer implementation is rock solid. For simple demonstration I've just used a simple field separator here...
(04.07.2017 at 08:50)
Reguel Werme... ♦♦
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 03.05.2017 at 09:41
Seen: 3,095 times
Last updated: 07.03.2018 at 10:22
i have found the root cause. it's because on new version we just changed the type of property
qualificationMessageResults.message
from String to an object type, so it lead to issue that when we deploy this version to server, the old business data (where message is still String type) can not be index anymore. And it throw exception unknow property descriptor.Problematic is that ElasticSearch already determined the type of this field as string. I heard elasticsearch has way to reindex, does ivy support it?
Currently there is no API in the axon.ivy core that would trigger an index-recreation or schema update on the ElasticSearch server. But you could basically flush the whole ElasticSearch index and trigger the axon.ivy engine to synchronize its data again with the ElasticSearch index. The API to do so is here:
ch.ivyteam.ivy.business.data.store.restricted.IBusinessDataManager.startIndexRecreation()
. There is also a built in mechanism on axon.ivy engine startup that synchronizes the indexes if the ElasticSeach index is not up to date.