Forum Discussion

FabioG's avatar
FabioG
New Contributor III
4 days ago

Using Assembly's XFBRs

Hi all,

I'm in trouble in using an XFBR from an Assembly, inside a Data Adapter.

I've just discovered that it's possible to use the XFBR function as part of a SQL Command, like this:

SELECT * FROM MyTable WHERE MyField = 'XFBR(MyBR, MyFunction, Param1=|!prm_Whatever!|)'

I was surprised to see it working, but this is not the point.

When MyBR is defined as a Business Rule, everything isworking fine.

Then I moved the Business Rule into a Service XFBR. Since the Factory is defined at Workspace level, I converted the query as:

SELECT * FROM MyTable WHERE MyField = 'XFBR(WS, MyFunction, Param1=|!prm_Whatever!|)'

Directly testing the Data Adapter everything works fine, I can see the converted query and also the results.

Now, the problems:

The above mentioned Data Adapter is used by a Report. When the XFBR is defined under the Business Rules area, everything is ok.

When I launch the report (from a Dashboard), i get the following error:

Error processing XFBR String 'MyFunction'. Unable to find the Workspace Assembly Service Factory class for name 'WS' in Workspace 'Default'

Not clear what I'm missing. Can someone point me in the right direction, please ?

 

As an additional info, let me say that the DataSet/DashBoard/etc were moved from the Default WorkSpace into a brand new WorkSpace (but I cannot see any reference to the Default WorkSpace in Data Adapter or Report)

 

Thanks a lot

FabioG

  • FabioG's avatar
    FabioG
    New Contributor III

    Thanks DanielWillis for your answer,

    made some more test on my Data Adapter, executing it through the "Test Data Adapter" button. I changed the query, just to see how translation behaves:

    AND a.Cube LIKE 'XFBR(WS, All2Like, Param=TEST)'
    AND a.Cube LIKE 'XFBR(Workspace.MyActualWorkspaceName.MyActualAssemblyName, All2Like, Param=TEST)'
    AND a.Cube LIKE 'XFBR(Workspace.Current.MyActualAssemblyName, All2Like, Param=TEST)'
    AND a.Cube LIKE 'XFBR(XFBR_GetParamValue, ParamValue, Param=TEST)'  => This is the "old style" Business Rule

    Once translated it's like this:

    AND a.Cube LIKE 'TEST'
    AND a.Cube LIKE '#ERROR: XFBR[Workspace.MyActualWorkspaceName.MyActualAssemblyName, All2Like, Param=TEST]'
    AND a.Cube LIKE '#ERROR: XFBR[Workspace.Current.MyActualAssemblyName, All2Like, Param=TEST]'
    AND a.Cube LIKE 'TEST'

    I'm currently on 8.4.0, I'll manage to repeat those tests on 8.5

     

    Best Regards

    FabioG

  • FabioG's avatar
    FabioG
    New Contributor III

    Thanks DanielWillis and sameburn for your answers,

    Unfortunately, no luck yet.

    I made one more test, setting the factory at the MU level, changing the query as:

    SELECT * FROM MyTable WHERE MyField = 'XFBR(WSMU, MyFunction, Param1=XYZ)'

    I removed the OS Param, so I removed a doubt about it.

    If I "Test" the Data Adapter, it works fine.

    If I run the Report from Report Designer it works fine.

     If I run the report from my dashboard, I get the following error:

    Error processing XFBR String 'MyFunction'. Unable to find the Workspace Assembly Service Factory class for name 'WSMU' in Workspace 'Default' and Maintenance Unit ''

    No problems at all if I call a "traditional" XBFR (outside from the Workspace)

    Thanks for your effort

    FabioG

    • DanielWillis's avatar
      DanielWillis
      Valued Contributor

      Just tried to remember what our issue was. Someone was having trouble with a parameter that I'm sure was working previously now complaining about the same thing as yours. The parameter referenced an XFBR in a workspace service factory. Had to change to directly reference rather than use WS/WSMU. They were in the middle of UAT and didn't have time to look into it a great deal. Not sure if they ended up figuring out why the original issue occurred.

      Changed to: XFBR(Workspace.WorkspaceNameHere.AssemblyNameHere,XFBRNameHere)

      XFBRNameHere being what lands in args.FunctionName

  • sameburn's avatar
    sameburn
    Contributor III

    Hi FabioG

    Are you logging the result of your parameter passed into your XFBR?

    Also have you tried passing in fully substantiated parameter name e.g

    SELECT * FROM MyTable WHERE MyField = 'XFBR(WS, MyFunction, Param1=|!Default.prm_Whatever!|)'?

    Now that you have moved from default workspace that might be the issue

    Hope this helps

    Sam

     

  • DanielWillis's avatar
    DanielWillis
    Valued Contributor

    Not sure if same but I had a similar instance where it was looking in Default workspace and I couldn't see any logical reason for it to do so. It also seemed to happen after actually working for some time. I chalked it up to a bug and just had to work around it at the time by not using the "WS" shortcut and instead using a direct reference (using the assembly name)