i2group / analyze-connect-node-sdk

Develop connectors that bring data from external sources into i2 Analyze by using the i2 Connect Node SDK. The SDK is comprised of documentation, tools, and sample code.
https://i2group.github.io/analyze-connect-node-sdk/
MIT License
3 stars 3 forks source link

Record on chart not updated #19

Closed stvdo closed 8 months ago

stvdo commented 8 months ago

Good afternoon,

I have a question about enriching entities on the chart via connector.

i2 Analyze v4.4.3 with fixpack i2 containers 2.8.0 ANBP 10.0.1

  1. I added a Vehicle to the chart with License plate 192KMB image
  2. I called a car registration connector. The car is found including the color etc image
  3. I copied the output of the connector to the chart image
  4. And the vehicle is updated as expected. image

Now I have a vehicle from another connector where the license plate is identically. But also the Type and Model are filled.

  1. I added the Vehicle to the chart image
  2. Via the connector I found the same details image
  3. But when I copied this connector output to the chart nothing happens.

I would expect the same results for the second scenario. Why is the color added in the first scenario and not in the second scenario?

Also the Identifier from both vehicles is the same. image

It seems that all properties are assigned correctly to the seed. image

I tested it also in i2 Notebook, there it works as expected in both scenario's.

Andrew-Stawarz-i2 commented 8 months ago

So looking at your issue, starting with the first part, first charting 192KMB with the first connector and it's coloured red.

  1. I presume to change the colour you have a Conditional Formatting Specification active in Live Formatting with a rule looking for "Vehicles" records from a given deployment and set the shading colour for the chart item containing the record based on the "Vehicle Color".
  2. All the source identifiers in the connector are marked as persistent/reproducible from the connector?
  3. Are there any other system matching rule in place? By default ANBP will match i2Connect results on source identifier and update accordingly, otherwise you are able to deploy system matching rules to to discriminator property based matching, for example Make + Model + License Plate.

With at least 1. above in place 192KMB from connector 1 that has a Red colour hits the chart and obtains a red icon shade.

Now the next step. Finding and charting the "same" 192KMB from connector 2. Is this a seeded query using 192KMB on the chart found in connector 1?

If so you should be able to modify the seed record received and return it in the results. The i2 Connect Gateway will have kept back some additional data ANBP attached to the seed record that you won't see in what is set to the connector and mark up the returned seed with any changes it has noticed in the round trip of that record. This allow ANBP to effectively rehydrate the record we asked the gateway to cache and then we apply the changes the gateway has detected in the returned seed (this allow us to preserve notes and source references that may have been applied, along with other metadata should the record be a store, IS, record).

However if you used the seed to, in effect, find a record that happened to have the same License Plate Number and return that in the results, unless there are system matching rules in place, recombining the returned record to what is already on the chart will be down to sourceID matching. Given it's from a different connector, the source ID the i2Connect gateway returns may include the connector ID and connector query ID. Therefore although both connectors may have given the same single string sourceID in both cases, the i2Connect gateway has decorated the result thus making the sourceIDs look different and not matching. This could be why from connector 2 192KMB was charted as a different chart item to the original seed, and given it didn't have colour information (I am assuming from the attributes put on the chart snapshot) the Live Formatting rule didn't change it to red.

stvdo commented 8 months ago

@Andrew-Stawarz-i2 thanks for your reply!

  1. I use indeed the Live Formatting for the color.
  2. How can I check that?
  3. I have one match rules for the entity person.

Connector 1: custom car registration connector. I used the service where use a vehicle as seed. The service will get extra information about the vehicle (like color etc) and returns this extra information. Connector 2: iBase connector. I retrieved the vehicle from iBase in the 2nd scenario.

For both 192KMB entities I use the same connector (connector 1) where the 192KMB is the seed.

In i2 Notebook it works as expected with the same connectors.

  1. Get vehicle from the User Guide db via the iBase connector image
  2. Retrieve extra information via the connector 1 image
  3. Copy to chart -> properties are added (as expected) image
Andrew-Stawarz-i2 commented 8 months ago

Hi @sdorresteijn88 ,

I would have expected the same behaviour in i2Notebook and ANBP whereby:

  1. Using connector 1, query A from a license plate number I get a vehicle 192KMB with partial details.
  2. Using 192KMB on the chart as a seed to connector 1 query B I get enriched details for the vehicle and that updates/replaces 192KMB that is already on the chart.

The above relies in items having the same seed ID and/or source ID (unfortunately source IDs are opaque to the user in the UI). No system matching rules for "Vehicle" were used.

In ANBP items are being charted as separate items.

I'll need to re-check the result charting code in ANBP 10.0.1.

Andrew-Stawarz-i2 commented 8 months ago

Hi @sdorresteijn88,

I've ploughed through the code in ANBP to check the seeding behaviour. Using our test i2Connect connectors I see the expected behaviour when you use one connector query to first search for a record and then use that result to seed a second query that will "enrich" the seed record with additional values. The enriched record result correctly merges back with the seed when set to the chart.

The same works when the above two operations are executed in i2Notebook.

What I have found, taking a leftfield approach, is if I first search for a record in i2Connect from within i2Notebook, chart the result, and then share that record so that it can be opened in ANBP, that shared record will appear as read-only (not user modifiable):

image

This is a bug. If I then try to execute the same seeded i2Connect query using the shared record in ANBP and chart the enriched resulting record then record on the chart is not updated. Why? In ANBBP we have logic that controls the updating of user or system governed (those typically ETL'd into the Information Store) records. Because i2Notebook marked the shared record as not user modifiable, ANBP interpreted this as a system governed record on charting.

stvdo commented 8 months ago

@Andrew-Stawarz-i2 it's for me not clear if the last part is also part of the description of the bug.

'This is a bug. If I then try to execute the same .... system governed record on charting.'

Can it be that this logic changed after 20-9-2023? At that moment I assume I had the most recent versions of all software. I have a note in the code of my connector that it was working in ANBP but not in i2 Notebook at that moment. Now it's the other way around it's working in i2 Notebook and not in ANBP.

Andrew-Stawarz-i2 commented 8 months ago

@sdorresteijn88 That's interesting to hear, you've observed a difference in ANBP External Searches/i2Connect behaviour between our 10.0.0 and 10.0.1 releases. The most significant change in ANBP in the 10.0.1 release (release notes: https://docs.i2group.com/release-material/anbp/10.0.1/i2-anbp-10.0.1.html) that would have impacted on Analysis Studio/Hub deployments was the addition of "Flexible chart item types and properties" from the palette, but that is still restricted to chart only operations.

I will need to diff the code base between those releases to see if there where any "unexpected" changes made around i2Connect interactions (seeding, charting and fusion/matching).

As for the bug I mentioned, this was found whilst I tried various combinations of seeding, charting of records and sharing records between our web and desktop notebook offerings. Records shared from i2Notebook with ANBP had an incorrect flag set on the shared record that would subsequently affect ANBP's charting of results from seeded i2Connect queries using those shared records.

Andrew-Stawarz-i2 commented 8 months ago

@sdorresteijn88 I've ploughed through the ANB and ANBP code changes between the 10.0.0 and 10.0.1 release and there has been no changes made that would have impacted on charting for i2Connect.

The last significant change was between 9.4.0 and 9.4.1 when handling charted iBase records as seeds for /i2Connect. Prior to that in August 2022 we fixed up behaviour in identifying i2Connect source identifiers that were reported by the connector as being persistent.

stvdo commented 8 months ago

@Andrew-Stawarz-i2 I used ANB 9.4.x at that time because iBase 9.2.1 was not released yet.

Anthony-Johnson-i2 commented 8 months ago

Hi @sdorresteijn88 (Steven)

It seems that what you are experiencing here is related to differences in how i2 Notebook and Analyst's Notebook Premium are behaving with respect to your i2 Connect charting.

Andrew has spent several hours looking in to this for you and we feel that as this is product related, and not SDK coding issues for example, we would be best to have this handled as a standard product related case.

Can you please raise this via support in the normal way and I will let our folks know that development are already aware of what you are experiencing here and it can be escalated immediately.

If you include a link to this GitHub Issue it will help avoid going over things again from your perspective unnecessarily.

Thank you.

stvdo commented 8 months ago

@Anthony-Johnson-i2 I'll raise a support ticket for this. Thanks for the investigation so far!

stvdo commented 6 months ago

Seems to be fixed in 2.9.0

Anthony-Johnson-i2 commented 6 months ago

Excellent news. thanks for the feedback @sdorresteijn88

Andrew-Stawarz-i2 commented 6 months ago

Good news @sdorresteijn88, now to find out what was changed between containers 2.8.0 and 2.9.0