Call Assembly Business Rule from another Workspace in a Data Management Step
I'm looking to call a business rule that is located in a different workspace within Assemblies but am unsuccessful. The first screenshot below shows my DM step configuration. The business rule I'm trying to call is an out-of-the-box rule within the Financial Close solution. The second screenshot shows the workspace (namespace prefix = OFC), the assembly (RCM) and the business rule (DiscoverRecons). The third screenshot shows the tool tip when you hover over "Business Rules" on the DM step. I've attempted many variations of the yellow highlighted syntax, always returning an invalid business rule error. The fourth screenshot shows the out-of-the-box DM step I'm emulating. I used this to verify the parameters I'm passing in work which they do. I've ensured that both the current workspace and OFC workspaces are sharable and include the shared workspace names. Does anyone know the correct syntax to call this rule into my DM step?81Views0likes7CommentsLiteral parameters and multiple users
Hi all, I'm currently developing a dashboard that will likely be used by multiple users at the same time. Users will be able to set some initial parameters within the dashboard, and click on a button that will trigger a BR that will return some output rows within a table in the database. After the process is complete, the user will be able to see the output rows through the following SQL Table Editor: the parameters that you can see in the "Where Clause" are literal parameters that are set from within the BR when it is triggered by the user (using BRApi.Dashboards.Parameters.SetLiteralParameterValue()), and their value depend on the initial parameters that the user selected in the dashboard. The problem is, I saw in some posts within the forum that literal parameters are "common" to all users, so every time one user will click the button and launch the process, the literal parameters will be changed. This is a problem, because we expect users to use the dashboard simultaneously. Is there a workaround that does not use literal parameters? Or is there a way to make literal parameters "unique" to every user? Thanks in advance!Solved8.4KViews0likes22CommentsEnforce Constraints on Data Table. Failed to enable constraints. One or more rows contain values.
I am trying to return a SQL query in a Data table inside the business rule. But I am Getting the issue: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. I tried to remove the constraint. Maybe I am doing it incorrectly or it is not possible. Dim sql As New Text.StringBuilder sql.AppendLine("Select COALESCE(S.RegisterID,O.RegisterID, W.RegisterID) RegisterID, ") sql.AppendLine("COALESCE(S.RegisterIDInstance,O.RegisterIDInstance,W.RegisterIDInstance) RegisterIDInstance, ") sql.AppendLine("COALESCE(S.WFProfileName,O.WFProfileName,W.WFProfileName) WFProfileName, ") sql.AppendLine("COALESCE(S.WFScenarioName,O.WFScenarioName,W.WFScenarioName) WFScenarioName, ") '''''''''QUERY Continues as below SQL CODE. Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si) Dim ds As New DataSet ds.Tables.Clear() ds.EnforceConstraints = False Dim dt As DataTable = ds.Tables.Add() ' error comes when executing next line dt = BRApi.Database.ExecuteSql(dbConnApp, sql.ToString, False) Dim Count As Integer = dt.Constraints.Count BRApi.ErrorLog.LogMessage(si, "Count: here2") Return dt End Using The SQL query generates a table in a Data Adapter dashboard component. But the rule fails as the Data table does not enforce constraints through data coming from SQL. The SQL query: Select COALESCE(S.RegisterID,O.RegisterID, W.RegisterID) RegisterID, COALESCE(S.RegisterIDInstance,O.RegisterIDInstance,W.RegisterIDInstance) RegisterIDInstance, COALESCE(S.WFProfileName,O.WFProfileName,W.WFProfileName) WFProfileName, COALESCE(S.WFScenarioName,O.WFScenarioName,W.WFScenarioName) WFScenarioName, COALESCE(S.WFTimeName,O.WFTimeName,W.WFTimeName) WFTimeName, COALESCE(NULLIF(O.JobTitle,''),W.JobTitle) JobTitle, COALESCE(NULLIF(O.LastName,''), W.LastName) LastName, COALESCE(NULLIF(O.FirstName,''), W.FirstName) FirstName, COALESCE(O.Wage,W.Wage) Wage, COALESCE(O.Bonus,W.Bonus) Bonus, COALESCE(O.FTE,W.FTE) FTE, COALESCE(O.GradeLevel,W.GradeLevel) GradeLevel, COALESCE(S.Status,O.Status,W.Status) Status, COALESCE(O.HireDate ,W.HireDate ) HireDate, COALESCE(O.HirePeriod,W.HirePeriod) HirePeriod, COALESCE(O.TermDate,W.TermDate) TermDate, COALESCE(O.TermPeriod,W.TermPeriod) TermPeriod, COALESCE(O.BirthDate,W.BirthDate) BirthDate, DATEDIFF(month, '1/1/2024', IIF(CONVERT(varchar,COALESCE(NULLIF(O.TermDate,'1/1/1900 12:00:00 AM'), W.TermDate),101) = '1/1/1900','1/1/3999',CONVERT(varchar,COALESCE(NULLIF(O.TermDate,'1/1/1900 12:00:00 AM'), W.TermDate),101))) +1 As OutPeriod, COALESCE(S.OutCode,O.OutCode,W.OutCode) OutCode, DATEDIFF(month, '1/1/2024',IIF(CONVERT(varchar,COALESCE(NULLIF(O.DCode1,'1/1/1900 12:00:00 AM'), W.DCode1),101) = '1/1/1900','1/1/3999',CONVERT(varchar,COALESCE(NULLIF(O.DCode1,'1/1/1900 12:00:00 AM'), W.DCode1),101))) +1 As InPeriod, COALESCE(NULLIF(NULLIF(S.Entity,'None'),''),NULLIF(NULLIF(O.Entity,'None'),''),W.Entity) Entity, COALESCE(NULLIF(NULLIF(S.Code1,'None'),''),NULLIF(NULLIF(O.Code1,'None'),''), W.Code1) Code1, COALESCE(NULLIF(O.Code2,'None'), W.Code2) Code2, COALESCE(NULLIF(O.Code3,''), W.Code3) Code3, COALESCE(NULLIF(O.Code4,''), W.Code4) Code4, COALESCE(NULLIF(O.Code5,''), W.Code5) Code5, COALESCE(NULLIF(O.Code6,''), W.Code6) Code6, COALESCE(NULLIF(O.Code7,''), W.Code6) Code7, COALESCE(NULLIF(O.Code6,''), W.Code6) Code8, COALESCE(NULLIF(O.Code6,''), W.Code6) Code9, COALESCE(NULLIF(O.Code6,''), W.Code6) Code10, COALESCE(O.NCode1, W.NCode1) NCode1, COALESCE(O.NCode2, W.NCode2) NCode2, COALESCE(O.NCode3, W.NCode3) NCode3, COALESCE(O.NCode4, W.NCode4) NCode4, COALESCE(O.NCode5, W.NCode5) NCode5, COALESCE(O.NCode6, W.NCode6) NCode6, COALESCE(O.NCode7, W.NCode7) NCode7, COALESCE(O.NCode8, W.NCode8) NCode8, COALESCE(O.DCode1, W.DCode1) DCode1, COALESCE(O.DCode2, W.DCode2) DCode2, COALESCE(O.DCode3, W.DCode3) DCode3, COALESCE(O.DCode4, W.DCode4) DCode4, COALESCE(NULLIF(O.Annot1,''),W.Annot1) Annot1, IIF(COALESCE(S.Status,O.Status,W.Status) = 'Workday','Workday', 'People Register') As Annot2, XFW_PLP_CalcPlanDetail.CalcPlanDetailID As DetailID, XFW_PLP_CalcPlanDetail.FKClassID, XFW_PLP_CalcPlanDetail.Description, XFW_PLP_CalcPlanDetail.WeightOrCount, XFW_PLP_CalcPlanDetail.PeriodDivisor, XFW_PLP_CalcPlanDetail.PeriodFilter, XFW_PLP_CalcPlanDetail.Condition, XFW_PLP_CalcPlanDetail.EntityOverride, XFW_PLP_CalcPlanDetail.FlowOverride, XFW_PLP_CalcPlanDetail.ICOverride, XFW_PLP_CalcPlanDetail.UD1Override, XFW_PLP_CalcPlanDetail.UD2Override, XFW_PLP_CalcPlanDetail.UD3Override, XFW_PLP_CalcPlanDetail.UD4Override, XFW_PLP_CalcPlanDetail.UD5Override, XFW_PLP_CalcPlanDetail.UD6Override, XFW_PLP_CalcPlanDetail.UD7Override, XFW_PLP_CalcPlanDetail.UD8Override, XFW_PLP_CalcPlanDetail.Sequence From (Select * from XFW_PLP_Register where status='Workday' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024' ) W FULL OUTER JOIN (Select * from XFW_PLP_Register where Status = 'OneStream' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024') O On O.RegisterID = W.RegisterID LEFT OUTER JOIN (Select * from XFW_PLP_Register where Status = 'Split' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024') S On S.RegisterID = W.RegisterID CROSS Join XFW_PLP_CalcPlanDetail Where ( XFW_PLP_CalcPlanDetail.FKCalcPlanID = '01_ACTIVE_UK' And XFW_PLP_CalcPlanDetail.FKWFProfileName = 'PlanTemplate' And XFW_PLP_CalcPlanDetail.FKWFScenarioName = 'PlanTemplate' And XFW_PLP_CalcPlanDetail.FKWFTimeName = 'PlanTemplate' ) Order By RegisterID,RegisterIDInstance,XFW_PLP_CalcPlanDetail.CalcPlanDetailID, XFW_PLP_CalcPlanDetail.Sequence7KViews0likes18CommentsHow to call a workspace assembly service from another workspace assembly service ?
Dear community, One of my use case is to create a function that I would commonly use in any other workspace. I haven't seen a community message about it, and the documentations does not specify how to do so, so here's the use case : I have a Workspace A (name: WorkspaceA), with an assembly named WA_Assembly, and in it are my services & functions that I want to reference and use. I have a Workspace B, where I need to call the functions from Workspace A. SOLUTION : Create a new dependency in Workspace B : Dependency Type : "Workspace Assembly" Shared Workspace Name : WorkspaceA Dependency Name : WA_Assembly Then, in a given Workspace B service, use Imports Workspace.WorkspaceA.WA_Assembly (vb.net) or using Workspace.WorkspaceA.WA_Assembly (C#) for referencing the Shared Public Functions. Then you will be able to use these functions in another workspace ! Just adding this message for future references :)33Views2likes1CommentSaveFileBytesToUserTempFolder returning an error message
Hi, I am trying to use the Business Rule API "SaveFileBytesToUserTempFolder" in order to open a file stored as a byte in a datatable. This is exactly like in the "Reporting Compliance" dashboard, where the file is stored as bytes in a datatable. I am actually using the exact same business rule ! However, there is an issue in my case. My business rule that is used to view the document works fine until the very last step... this is the one causing the error ( I have tested FileName and FileBytes fields and these exist) : BRApi.Utilities.SaveFileBytesToUserTempFolder(si, si.UserName, dt(0)("FileName"), dt(0)("FileBytes")) Error message : An error occurred while receiving the HTTP response to http://localhost:50002/OneStreamApp/SVC/XFFileSystem.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. The underlying connection was closed: An unexpected error occurred on a receive. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host (Socket Error Number 10054). The exact same file is used in Reporting Compliance and I can view it. Am I missing something ? I don't find any documentation on this function ... Regards,4.5KViews0likes12CommentsPublic Overloads Function GetBusinessRules
I have seen several MaketPlace solutions rules that give me a warning message when I compile in v 7.1.1. See the example below: Warning at line 410: 'Public Overloads Function GetBusinessRules(si As SessionInfo, brType As BusinessRuleType) As List(Of BusinessRuleSummaryInfo)' is obsolete: 'This is a temporary function used by Marketplace Solutions for backwards compatibility with old XF versions. Please change your code to use supported functionality.'. Not sure how these rules will behave when we upgrade to v 8.5, but I was wondering if there is an easy fix out there which will remove this warning message.30Views0likes1CommentGetting Column Text Value from Derivative Rule
Hi I have a derivate rule that I created that returns the absolute value of an amount based on column name. The column names are assigned in the data source and based on the data source column it will either assign an absolute value or a negative value. I want to be able to pull a column in my derivate rule that is a text attribute column and if the text equals something like "S5" it will do some type of conditional logic. With my limited experience with derivative rules and research it seems this cannot be done via a derivative rule. First question: Is there a way for me to do this? Second: If not, is there another alternative way that I can extract the text field of a column and based on that to do some type of additional logic?24Views0likes1CommentIs it possible to extract(as xml) a Maintenance Unit and it's components using extensibility rule?
Hello OneStream experts, We are trying to extract a maintenance unit and all it's components underneath it using a BR/Extensibility rule with the latest OS version - 9.0.1. But, however after the run we could able to see a empty xml in the fileshare folder. Below is the snippet of code which we are using. Any suggestions or help would be greatly appreciated. Thanks! Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object Try Select Case args.FunctionType Case Is = ExtenderFunctionType.ExecuteDataMgmtBusinessRuleStep, ExtenderFunctionType.Unknown 'Get Configuration Settings Dim configSettings As AppServerConfigSettings = AppServerConfig.GetSettings(si) 'Data Management extract location Dim folderPath As String = FileShareFolderHelper.GetDataManagementExportUsernameFolderForApp(si, True, configSettings.FileShareRootFolder, si.AppToken.AppName ) & "\" & DateTime.UtcNow.ToString("yyyyMMdd") & "\Extracts" 'If the directory does not exist create If Not Directory.Exists(folderPath) Then Directory.CreateDirectory(folderPath) 'Full path and file name for extract Dim filePath As String = folderPath & "\MaintainanceUnitBkp " & DateTime.UtcNow.ToString("yyyyMMdd") & ".xml" 'If file already exist If File.Exists(filePath) Then File.Delete(filePath) 'Extract Options ' Dim xmlOptions As New XmlExtractOptions ' xmlOptions.ExtractAllItems = False Dim xmlOptions As New XmlExtractOptions Dim dashboardOptions As New DashboardMaintUnit xmlOptions.ExtractAllItems = False 'Extract Maintainance Unit Dim extractDict As New Dictionary(Of XmlExtractItemPk, Boolean) Dim strMaintUnit As String = "DataExtract_Main" 'Maintenance Unit extractDict.Add(New XmlExtractItemPk(XmlExtractItemType.DashboardMaintUnit, strMaintUnit), True) 'Execute the Metadata Extract Using dbConnFW As DbConnInfo = BRApi.Database.CreateFrameworkDbConnInfo(si) Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si) 'Extract XML metadata to target location File.WriteAllText(filePath, MetadataExtract.ExtractXml(dbConnFW, dbConnApp, xmlOptions, extractDict)) File.WriteAllText(filePath,XmlExtractController.ExtractXML(dbConnFW,dbConnApp,Nothing,xmlOptions,extractDict,XmlLoadExtractType.ApplicationWorkspaces)) End Using End UsingSolved79Views0likes4CommentsHow to pull a field from Custom table into a Cube view
Hi Everyone, I have a requirement to pull the data in a particular format in my cube view. I have entity dimension members in a row which gets pulled from the cube. I have to pull the respective opening dates of the stores from the custom table in the cube view as a column. I have created the custom table (with store and opening date) and used a business rule to pull the opening date from the custom table. Now I want to display this in the cube view w.r.t the stores we are pulling in rows. For ex if we have a row with Entity (store) tx0001 in the cube view which has an opening date for the store in the custom table. This opening date needs to be displayed in the column w.r.t to the store in the row. How to achieve this? Thanks, Jeevan48Views0likes3CommentsCustomSubstVars Warning Message
I am looking to upgrade from 7.1 to 8. In the process of compiling dashboard extender rules, I get the following warning message. Warning at line 50: 'Public Overloads ReadOnly Property TaskInfo As XFSelectionChangedTaskInfo' is obsolete: 'This is a temporary function used by Marketplace Solutions for backwards compatibility with old XF versions. Please change your code to use supported functionality. Use SelectionChangedTaskInfo instead.'. Question. Is there an alternative syntax that will achieve the same result? As best as I can decipher, the code in question (below) is to retrieve the value from the bound parameter LastActMonth_BDA into a new variable titled newLastActMth. Dim newLastActMth As String = args.TaskInfo.CustomSubstVars("LastActMonth_BDA")Solved42Views0likes3Comments