Forum Discussion
ChrisLoran I assume that for every transformation, the transformation event handler business will be called.
How do i filter that it runs only for specific workflow profile ?
*looks like we were both typing an answer at the same time*
For every transformation process , yes the transformation event handler will be called, but not for every transformation (as in each data row).
So the Transformation Event Handler may be run concurrently if multiple users are performing import processes.
To filter only specific workflow profile, you can get the name of the workflow profile using the Transformer class instance, which is supplied in args.Inputs(0).
Example below:
If args.IsBeforeEvent _
AndAlso args.OperationName = BREventOperationType.Transformation.ParseAndTrans.ProcessTransformationRules Then
' -- do your stuff just before transformation rules are processed --
Dim objTransformer As Transformer = DirectCast(args.Inputs(0), Transformer)
brapi.ErrorLog.LogMessage(si, args.OperationName & ", ProfileName=" & objTransformer.WorkflowProfile.Name)
End If
For filtering only certain workflows, it's better to test the Text property of a workflow profile , rather than hard-code the profile name into rules.
These answers are not an endorsement of dynamically modifying transformation rules on the fly.
Any updates to transformation rules, should be protected by being enclosed within a SyncLock statement to ensure multiple parallel threads do no try to perform updates at the same time.
Related Content
- 11 months ago
- 10 months ago
- 4 months ago