In my Trigger, I want to query contracts, but i dont want to list those templates under the registeredTemplates section. I tried this, but the query unregistered templates doesnt return any contracts. But if i register this template, then it will also generate an event each time this template creates a contract, and i want to avoid that.
The use case is more like syncing two set of contracts(Think like i am syncing two separately developed daml models) . Say the first set has a template called deposit, against which i need to sync the second set of contracts. The flow I want to achieve is this
Deposit Contract creation -> Trigger the Rule ----> In the Rule ------> Query the tokenoffer template, Exercise choice Buy on Tokenoffer
The problem occurs, when the trigger exercise choice Buy, which results in multiple contracts, including a new token offer with the balance quantity. So if the token offer template is registered, this will trigger a new event.