Forum Discussion

OSEmployee1007's avatar
OSEmployee1007
New Contributor III
6 months ago

Workspace Assembly - Call functions from Finance or Connector business rules

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!

  • 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.

     



  • Henning's avatar
    Henning
    6 months 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 ğŸ™‚

     

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    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.

     



    • Henning's avatar
      Henning
      Valued Contributor II

      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 ğŸ™‚

       

      • DanielWillis's avatar
        DanielWillis
        Valued Contributor

        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.

    • OSEmployee1007's avatar
      OSEmployee1007
      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. 

      Thank you for your time. 

       

  • Henning's avatar
    Henning
    Valued Contributor II

    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!

  • OSEmployee1007's avatar
    OSEmployee1007
    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's avatar
    RobbSalzmann
    Valued Contributor II

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