Forum Discussion
photon
2 years agoContributor
incorrect scenario running scheduled job using WFScenario parameter
Currently, we have a manual process that involves a user running a Load and Transform that uses a data source with a DM Sequence as its source. That sequence uses the |WFScenario| parameter.
This a...
- 2 years ago
Alright, si.PovDataCellPk still failed but it did inspire me to check other parts of si and this solves the problem:
si.WorkflowClusterPk.ScenarioKey = BRApi.Finance.Members.GetMemberId(si,DimTypeId.Scenario,scenario) si.WorkflowClusterPk.TimeKey = BRApi.Finance.Time.GetIdFromName(si,year) si.WorkflowClusterPk.ProfileKey = BRApi.Workflow.Metadata.GetProfile(si,wfName).UniqueIDThe profile key override isn't strictly necessary for the export/import part of this but there's additional downstream code that looks at the staged results and for that the WF key is relevant. I've shipped this off to my users for testing but it appears to be good for now.
photon
2 years agoContributor
Alright, si.PovDataCellPk still failed but it did inspire me to check other parts of si and this solves the problem:
si.WorkflowClusterPk.ScenarioKey = BRApi.Finance.Members.GetMemberId(si,DimTypeId.Scenario,scenario)
si.WorkflowClusterPk.TimeKey = BRApi.Finance.Time.GetIdFromName(si,year)
si.WorkflowClusterPk.ProfileKey = BRApi.Workflow.Metadata.GetProfile(si,wfName).UniqueID
The profile key override isn't strictly necessary for the export/import part of this but there's additional downstream code that looks at the staged results and for that the WF key is relevant. I've shipped this off to my users for testing but it appears to be good for now.
DanielWillis
2 years agoValued Contributor
Just randomly came across this thread. I wonder if it would be safer to override the whole workflowcusterPK. E.g.,
Dim wfClusterPK As WorkflowUnitClusterPk = brapi.Workflow.General.GetWorkflowUnitClusterPk(si,wfName,scenario,year)
si.WorkflowClusterPk = wfClusterPK
Related Content
- 2 years ago
- 2 years ago
- 2 years ago