The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
IrinaDragusanu
1 year agoContributor
Lookup Transformational rule UNDO
Hello. I have a set of Lookup Transformational rules. I have tried to load a mass upload for multiple lines of transformational rules through a trx file. I had a message saying the load has been comp...
- 1 year ago
Hi Chul,
Thanks for your reply. The above suggestion didn't work. The background is:
I have loaded a mass trx file to load some transformational rules. I imagine my beginner trx file was broken. It loaded the rules in the background but not showing in the Rules set. We were able to find the imported rules in the Application Database Tables. So we used the Rules IDs to delete them with a custom BR rule. However it is not recommended to use this type of BR rule that deletes the rule IDs from the Data Tables, as it can mess up the system if something goes wrong. Hope it helps.
IrinaDragusanu
1 year agoContributor
Hi Chul,
Thanks for your reply. The above suggestion didn't work. The background is:
I have loaded a mass trx file to load some transformational rules. I imagine my beginner trx file was broken. It loaded the rules in the background but not showing in the Rules set. We were able to find the imported rules in the Application Database Tables. So we used the Rules IDs to delete them with a custom BR rule. However it is not recommended to use this type of BR rule that deletes the rule IDs from the Data Tables, as it can mess up the system if something goes wrong. Hope it helps.
DanielWillis
1 year agoValued Contributor
Any idea what caused it? Anything funny about the rule?
- MarcusH1 year agoValued Contributor
The TRX load process does only very basic checks on the records being loaded. I have had instances where the TRX file is loaded without any errors but the maps do not appear. When I looked at the database table I could see that the record was present but the RuleType was invalid (I think that was it). It isn't a major problem as the users do not maintain the maps and we use the XML format. If it were to become a problem, I would add a Rule to the TransformationEventHandler to delete any invalid map records.
- IrinaDragusanu1 year agoContributor
Yes, this is exactly what happened.
In regards to the last phrase as a solution, Will this rule run in the background and automatically delete the invalid entries? or does it need to be manually run? Is there any example of bit of code you could help provide please? Thanks in advance.
- MarcusH1 year agoValued Contributor
The TransformationEventHandler is automatically executed whenever the Load and Import process is executed. Create a new Business Rule and select Transformation Event Handler from the list if you do not already have one - it will be in the Extensibility Rules section. Then add this code to the Select Case args.OperationName section:
Select Case args.OperationName Case Is = BREventOperationType.Transformation.ParseAndTrans.InitializeTransformer If args.IsBeforeEvent = True Then Dim numRecordsDeleted As Integer = 0 Using dbConnApp As DbConnInfo = BRAPi.Database.CreateApplicationDbConnInfo(si) Dim sqlStatement As String = "DELETE FROM STAGERULES WHERE RULETYPE NOT IN (1,2,3,4,5,50,51,100)" numRecordsDeleted = BRApi.Database.ExecuteActionQuery(dbConnApp, sqlStatement, False, True) End Using If numRecordsDeleted > 0 Then BRApi.ErrorLog.LogMessage(si, "Transformation Rules deleted", numRecordsDeleted.ToString & " transformation records deleted") End If End If End SelectThis is assuming that the problem is that an invalid RuleType record is being created.
- DanielWillis1 year agoValued Contributor
Interesting, thanks Marcus. I haven't experienced this so was curious for more info in case I do one day!
- IrinaDragusanu1 year agoContributor
My guess is that there could have been something wrong with the template loaded with the rules. I've created it from scratch so I might have missed a coma or something else.
Related Content
- 2 years ago
- 4 years ago
- 2 years ago
- 1 year ago