How to call a function in Workspace assemblies?

marcobobbiesi
New Contributor III

Hi guys,

I coudn't find the proper hint in OneStream.

In my dashboards, I'm using several XFBR string rules or Dashboard extender rules. I would like to move some of them to Workspace assemblies, available starting version 7.4. If I do so, does anybody know how to call a function in there?

Stupid example, I'm defining the position of a temporary file to download with an XFBR rule called MyXFBR, function CleanUsername.

UrlOrFullFileName=[Internal/Users/XFBR(MyXFBR, CleanUsername)/Temp/FileToDownload.csv]

 

Now I've created the same function CleanUsername in a Workspace assembly named MyAssembly, in a file named FolderManagement.vb. How this should be amended?

XFBR(MyXFBR, CleanUsername)

?? XFBR(MyAssembly, FolderManagement, CleanUsername) ?? it doesn't look very good....

 

That's pretty new, but I hope a few guys in this community have used it already.

 

2 ACCEPTED SOLUTIONS

hiren
New Contributor III

Use the following syntax instead of just RuleName,
Workspace.<WorkspaceName>.<AssembleName>.<RuleName>

Example- 

 

XFBR(Workspace.MyWorkspace.MyAssembly.ParamHelper, CleanUsername) 

 

View solution in original post

 

Try this:   XFBR(Workspace.Current.MyAssembly.FileName, FunctionName)

View solution in original post

7 REPLIES 7

hiren
New Contributor III

Use the following syntax instead of just RuleName,
Workspace.<WorkspaceName>.<AssembleName>.<RuleName>

Example- 

 

XFBR(Workspace.MyWorkspace.MyAssembly.ParamHelper, CleanUsername) 

 

marcobobbiesi
New Contributor III

Hi hiren,

thanks a lot for the hint. But actually it does not work with me, I've also tried with a simpler case creating a dashboard extender and logging a fixed message just to see whether the rule is call and apparently it's not called at all. I've used Default as workspace, the name of my asembly (XICO_Folder) and the fileName (FolderMgmt), tried with and without .vb and even renaming it without vb) and nothing is fired.

XFBR(Default.XICO_Folder.FolderMgmt, CleanUsername)

But I understand this is working on your side, isn't it? is there any pre-requisite, like making the assembly/folder/file visibile? I really can't find documentation or examples about it and such a small thing is driving me crazy.

 

 

Try this:   XFBR(Workspace.Current.MyAssembly.FileName, FunctionName)

Guys,

thank you again, thank you soo much!! This is now working. I've just missed the workspace-dot, stupid me.
There's one curiosity I have. I did not manage to have it working if I keep the ".vb" extension in the filename. I don't mind about it at all and I'm happy to rename the file without any extension, but am I doing something wrong or do you share the same "issue"?

 

 

hiren
New Contributor III

Sharing few screenshots,
Screenshot 2023-05-09 at 9.31.09 AM.pngScreenshot 2023-05-09 at 9.30.34 AM.png

 

 

 

 

 

 

 

 

 



As @SStalker mentioned, if the assembly is in same workspace you can also use Current keyword instead of Workspace Name. 

SStalker
New Contributor III

If the assembly is inside the same workspace you can use "Workspace.Current".  Note that you do not need to specify the folder name as you cannot have the same file name i different folders.  I'm not sure if it actually blocks you from creating the same file but I'm fairly sure it will fail on compile.

XFBR(Workspace.Current.MyAssembly.FileName, FunctionName)

hiren
New Contributor III

I tried this & thought I would share it here.
You are right, OS does allow creating same file names across different folders (However, It does block creating duplicate filenames in same folder, may be good to have update in future release :D) but fails during compilation due to namespace conflicts,
Screenshot 2023-05-09 at 9.40.15 AM.png