3 weeks ago - last edited 3 weeks ago
Hi Everyone, has anyone already tried to reference a Workspace Assembly business rule from a Finance or a Connector business rule?
I have a business rule that is packaged to an Assembly in a Workspace:
It has a set of public functions returning dictionaries and other variables. And I would like these functions being called from a Connector.
I can successfully reference it from another Assembly workspace. But when I am using the same syntax in a connector, that is not working:
I am assuming the referenced Business rule must be declared in the Properties, but I am not sure of the syntax. Or even sure this is accepted.
Many thanks to anyone who can helps!
Solved! Go to Solution.
3 weeks ago - last edited 3 weeks ago
Assemblies are referenced by importing the namespace
Imports Workspace.__WsNamespacePrefix.__WsAssemblyName.DashboardExtender.TXM_Merger_SolutionHelper
Then to use it:
Dim merger_SolutionHelper as new TXM_Merger_SolutionHelper.MainClass
Also, don't use the implementation namespace (TXM_Merger_SolutionHelper) as a variable name. It will cause issues.
3 weeks ago
Thank you very much @RobbSalzmann , I got this to work using a super simple test example. Hope this helps the other possible audience. I am running this on 8.1.
I created a new blank workspace, maintenance unit and assembly:
With a simple file to write something into the error log:
Then I created an Extender rule to execute this using the following properties:
When I run this...
...the message appears as expected 🙂
3 weeks ago - last edited 3 weeks ago
Hi, I think Daniel already figured this one out - quoting @DanielWillis :
In your Referenced Assemblies you want to put: WS\Workspace.YourWorkspaceName.YourAssemblyName
Then in your rule you should be able to do something like these depending on your setup:
Dim yourClassName As New Workspace.YourWorkspaceName.YourAssemblyName.YourClassName
Dim yourClassName As Workspace.YourWorkspaceName.YourAssemblyName.BusinessRule.DashboardExtender.YourFileName.MainClass
Let us know if this works so that other members can leverage that as well!
3 weeks ago - last edited 3 weeks ago
Hi Henning,
No, that is not working. I tried different options with the Namespace prefix or the workspace name, that doesn't work.
I tried different options, that I mentioned below. Unfortunately, none of them works so far...
Thanks for your time and your help Henning.
WS\Workspace.TXM_IC_Matching.TXM_Merger
WS\Workspaces.TXM_IC_Matching.TXM_Merger
WS\TXM_IC_Matching.TXM_Merger
BR\Workspace.TXM_IC_Matching.TXM_Merger
BR\Workspaces.TXM_IC_Matching.TXM_Merger
WS\Workspace.TXM_IC_Matching.TXM_Merger\TXM_Merger_SolutionHelper
WS\Workspaces.TXM_IC_Matching.TXM_Merger\TXM_Merger_SolutionHelper
WS\TXM_IC_Matching.TXM_Merger\TXM_Merger_SolutionHelper
BR\Workspace.TXM_IC_Matching.TXM_Merger\TXM_Merger_SolutionHelper
BR\Workspaces.TXM_IC_Matching.TXM_Merger\TXM_Merger_SolutionHelper
3 weeks ago - last edited 3 weeks ago
Assemblies are referenced by importing the namespace
Imports Workspace.__WsNamespacePrefix.__WsAssemblyName.DashboardExtender.TXM_Merger_SolutionHelper
Then to use it:
Dim merger_SolutionHelper as new TXM_Merger_SolutionHelper.MainClass
Also, don't use the implementation namespace (TXM_Merger_SolutionHelper) as a variable name. It will cause issues.
3 weeks ago - last edited 3 weeks ago
Hi Rob, thank you for your answer.
I have tried to add the following imports in my Connector business rule:
Imports Workspace.__WsNamespacePrefix.__WsAssemblyName.DashboardExtender.TXM_Merger_SolutionHelper
Imports Workspace.TXM_IC_Matching.TXM_Merger.DashboardExtender.TXM_Merger_SolutionHelper
Imports Workspace.TXM_IC_Matching.TXM_Merger.BusinessRule.DashboardExtender.TXM_Merger_SolutionHelper.MainClass
This is providing Warnings, that doesn't seem to be recognized.
Thank you for your time.
3 weeks ago
Thank you very much @RobbSalzmann , I got this to work using a super simple test example. Hope this helps the other possible audience. I am running this on 8.1.
I created a new blank workspace, maintenance unit and assembly:
With a simple file to write something into the error log:
Then I created an Extender rule to execute this using the following properties:
When I run this...
...the message appears as expected 🙂
3 weeks ago
I feel like this would work without the 'Imports' statement since you have it on referenced assemblies and are using the full path when you create the class.
3 weeks ago
Hi Daniel, thank you, good call, you are correct. Not sure what I missed in my earlier testing, probably a typo or so. Now when I re-test without the "Imports" statement, it works just as you say!
3 weeks ago
The code is compiling and working. The issue is none of your assembly seems to be public. post the code and I can help.