You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing this workup item after a call with transformation services team
Problem
Calling getters on the transformer such as :
provenanceDb
provenanceSourceDb
isForwardSync
isReverseSync
Would lock in incorrect values if they were called too early. This is because a property 'isSynchronization' needs to be set to true before the syncDirection is accurately determined.
We had a few potential solutions:
Solution 1
use a private property to make sure that processAll / processChanges has been called before accessing provenanceDb / provenanceSourceDb getters. Throw error if not.
Problems:
services team could easily set this private property if they wanetd.
Solution 2
Add hooks / callbacks that would be called on events such as onTransformerInitialized.
prov db and sync getters would be removed, but that information would be passed ot the callbacks.
Problems:
callbacks make consumers dependent on the order they're called in
Solution 3
Pass to transformer ctor additional options: iSsynchronization: boolean. processAll and processChanges will be merged into one process() method
initialize would be moved into function which is responsibility of consumers to call. Then it shoudl be safe to access provenanceDb/sourceDb/ syncDirection.
Open Questions
Does transformation services ever set isSynchronization to true during a processAll?
Is there such thing as a processAll reverseSync? If isSynchronization is false, which it is in processAll. then that defauslt to assuming a forward sync.
If consumer fails to call initialize, should we call it for them in the process function?
The text was updated successfully, but these errors were encountered:
Does transformation services ever set isSynchronization to true during a processAll?
No. We only do that when we are going to call processChanges and want to call initialize before that.
Is there such thing as a processAll reverseSync? If isSynchronization is false, which it is in processAll. then that defauslt to assuming a forward sync.
Reverse synchronization is always a change processing workflow on our side.
If consumer fails to call initialize, should we call it for them in the process function?
From our perspective, I would rather have it manually invoked only and have the transformer throw something like a "NotInitializedError" if we forgot to do it. Reason for that being is that initialize will be a complex and heavy operation, and the transformer might even add elements into iModels when you call it. I wouldn't want such a thing be implicitly called, and the user should understand it and call it explicitly. Similar to "I agree with terms and conditions" Accept button
Writing this workup item after a call with transformation services team
Problem
Calling getters on the transformer such as :
Would lock in incorrect values if they were called too early. This is because a property 'isSynchronization' needs to be set to true before the syncDirection is accurately determined.
We had a few potential solutions:
Solution 1
use a private property to make sure that processAll / processChanges has been called before accessing provenanceDb / provenanceSourceDb getters. Throw error if not.
Problems:
Solution 2
Add hooks / callbacks that would be called on events such as onTransformerInitialized.
Problems:
Solution 3
Pass to transformer ctor additional options:
iSsynchronization: boolean
. processAll and processChanges will be merged into one process() methodinitialize would be moved into function which is responsibility of consumers to call. Then it shoudl be safe to access provenanceDb/sourceDb/ syncDirection.
Open Questions
The text was updated successfully, but these errors were encountered: