04-26-2022 01:41 PM - last edited on 05-02-2023 10:07 AM by JackLacava
Happy end of masking!!
We are trying to pass multiple months to: wfClusterPkChild We tried to pass Qtr1.base but we get error message. Any suggestions on how to pass M1, M2 , M3 - which are base level children of Qtr1 ?
Here's our code:
wfClusterPk = BRAPi.Workflow.General.GetWorkflowUnitClusterPk(si, profileName, scenarioName, timeName) where timename is 2022M1
Dim wfClusterPkChild As New WorkflowUnitClusterPk(profileInfo.ProfileKey, wfClusterPk.ScenarioKey, wfClusterPk.TimeKey)
---
where timename is 2022M1 - it works great.
However, when we tried to make timename = Qtr1.base, we get error message.
When we try to display using wfClusterPkChild.ToString, we see this "ProfileKey (ffb8c7f5-2cc0-48bb-b483-a2c81cb84875), ScenarioKey (0), TimeKey (2022003000"
wfClusterPkChild= ProfileKey (ffb8c7f5-2cc0-48bb-b483-a2c81cb84875), ScenarioKey (0), TimeKey (2022003000),
wfClusterPk.TimeKey = 2022003000
Solved! Go to Solution.
04-27-2022 11:51 AM - edited 04-27-2022 11:55 AM
Frankly, I don't like manipulating wfCluster. I did have certain issues with processing order in the past when manipulating wfCluster. Can you simply execute the BR from Data Management? You can set your Time filter there and simply pull api.pov.time.name as time parameter.
But if you are still keen on passing the quarter The pass it without .base extension and stick it into the GetBaseMember
Dim arrMembers = BRApi.Finance.Members.GetBaseMembers(si, dimPk, memberId_of_Q1, dimDisplayOptions)
For each member in arrMembers...
....
Next
04-27-2022 10:10 AM
You can't pass the .base there. I'd suggest you execute
BRApi.Finance.Members.GetBaseMembers(si, dimPk, memberId, dimDisplayOptions)
Where memberID is you Qtr1 member id and run the loop for each member in that array assigning it to the WfCluster.
04-27-2022 10:18 AM
Thanks.
Another question:
What is WFCluster?
Another question:
I have been using this statement to debug and view the contents of WFCluster.
BRAPI.ErrorLog.LogMessage(si,"line 66" & wfClusterPkChild.ToString )
it displays wfClusterPkChild.ToString, we see this "ProfileKey (ffb8c7f5-2cc0-48bb-b483-a2c81cb84875), ScenarioKey (0), TimeKey (2022003000"
Are there other ways to view wfCluster?
04-27-2022 10:26 AM
Ok, let me thread carefully there, When you said you need to manipulate it, then I assumed you need it for certain purpose. Can you please specify that purpose?
04-27-2022 10:29 AM
I'm sorry , I'm not manipulating. I just want to know what is WFCluster contents. ?
Also, do you have a better way to see it's contents than using BRAPI.ErrorLog.LogMessage(si,"line 66" & wfClusterPkChild.ToString ) ?
04-27-2022 10:36 AM
Nah, I do the LogMessage all the time, really. That's the best way 🙂
By manipulating I meant "passing" a certain date there, that you are trying to do. Why do you need to know the WorkflouUnitClusterPKs for those periods? What are you trying to achieve?
04-27-2022 10:59 AM
I'm using this BR successfully to export data from staging tables to text file. I'm passing one month at a time to this business rule. I'm trying to pass 3 months instead of one month.
Thanks for your help. I'll award your answer as the solution.
04-27-2022 11:51 AM - edited 04-27-2022 11:55 AM
Frankly, I don't like manipulating wfCluster. I did have certain issues with processing order in the past when manipulating wfCluster. Can you simply execute the BR from Data Management? You can set your Time filter there and simply pull api.pov.time.name as time parameter.
But if you are still keen on passing the quarter The pass it without .base extension and stick it into the GetBaseMember
Dim arrMembers = BRApi.Finance.Members.GetBaseMembers(si, dimPk, memberId_of_Q1, dimDisplayOptions)
For each member in arrMembers...
....
Next
04-27-2022 12:11 PM
thanks. I am using a Data management to pass 1 month to this BR. I ended up hard coding - pass it M1, M2 M3 as parameters, then running the same code 3 times.
Thanks for your help. Are you a consultant?
04-27-2022 12:16 PM
Yessir, I am. And I am planning to be at Splash too 🙂
Any particular reason you can't pass the whole quarter as Qtr1.base in data management? Or is it Execute Business Rule Type of a step? There are multiple ways to run this functionality dynamically with easily maintainable artifacts. We should always stay away from hardcoding.
04-27-2022 12:21 PM
I'm Hard coding temporarily , as I have other BR challenges to deal with.
I'll soft code after i resolve the other BR issues. Thanks for your help.
Going to attend virtually. Too busy to fly out anywhere.