Workspace Assembly - Call functions from Finance or Connector business rules

alesage
New Contributor III

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:

alesage_0-1717678999084.png

 


alesage_0-1717678462245.png
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:
alesage_2-1717678514004.png

 

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.

alesage_3-1717678534316.png

Many thanks to anyone who can helps!

2 ACCEPTED SOLUTIONS

RobbSalzmann
Valued Contributor

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.

 



View solution in original post

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:

Henning_1-1717686917787.png

With a simple file to write something into the error log:

Henning_2-1717686987872.png

Then I created an Extender rule to execute this using the following properties:

Henning_3-1717687043765.png

When I run this...

Henning_0-1717686850898.png

...the message appears as expected 🙂

Henning_0-1717687213719.png

 

View solution in original post

8 REPLIES 8

Henning
Valued Contributor

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!

alesage
New Contributor III

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

RobbSalzmann
Valued Contributor

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.

 



alesage
New Contributor III

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. 

alesage_0-1717685901801.png

Thank you for your time. 

 

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:

Henning_1-1717686917787.png

With a simple file to write something into the error log:

Henning_2-1717686987872.png

Then I created an Extender rule to execute this using the following properties:

Henning_3-1717687043765.png

When I run this...

Henning_0-1717686850898.png

...the message appears as expected 🙂

Henning_0-1717687213719.png

 

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.

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!

RobbSalzmann
Valued Contributor

The code is compiling and working.  The issue is none of your assembly seems to be public.  post the code and I can help.

RobbSalzmann_0-1717686188065.png