Forum Discussion
Hi,
To call the business rule, the first step is to click on your rule's Properties tab and add the AELS_SolutionHelper rule to the Referenced Assemblies property. You would add BR\AELS_SolutionHelper.
To call the ApprovalSolutionOverwriteFunction in the AELS_SolutionHelper rule, the function must be declared as Public and not Private.
To make use of the public functions in the AELS_SolutionHelper rule, you need to create an instance of that rule in your rule. Assuming it is a Dashboard Extender rule, you would do:
Dim targetRule as new OneStream.BusinessRule.DashboardExtender.AELS_SolutionHelper.MainClass()
Assuming you are calling your rule as a Dashboard Server Task like this:
{yourcustomrule}{yourcustomfunction}{LeaseList=[!|prm_SelectedApprovalLeases_AELS|!]}, the LeaseList parameter is passed as a Name-Value pair, so you must also create and populate that object when calling the AELS_SolutionHelper rule from your rule.
Dim nvpSource As String = args.NameValuePairs.XFGetValue("LeaseList", String.Empty)
Dim nvp As New Dictionary(Of String, String)
nvp.Add("LeaseList", nvpSource)
Dim targetDashboardArgs as New DashboardExtenderArgs()
targetDashboardArgs.NameValuePairs = nvp
Finally, call the function in the AELS_SolutionHelper rule. Assuming the return type is a string and that ApprovalSolutionOverWriteParameters expects the 4 parameters below:
Dim result As String = targetRule.ApprovalSolutionOverwriteParameters(si,globals,api,targetDashboardArgs)
I hope this provides some guidance on how to approach the solution.
Kind regards,
Chris
Related Content
- 2 years ago
- 3 years ago
- 4 years ago