Skip to main content
Newcomer
November 7, 2022
Solved

Parser rule issue

  • November 7, 2022
  • 2 replies
  • 0 views

 

I have a parser rule that works fine for a Budget type scenario but does not read a WFText1 for a Scenario Type 2 .

I am using the below syntax to read the WFText1 property from a parser rule .This step is an import type step.

sruthy_1-1667817899107.png

It returns the GL list as blank for my scenario type 2 but works fine for my budget type scenario. Both are in different Workflow profiles.

It picks up the correct workflow profile as i checked after logging it but unable to somehow pick up the text 1 value .

 

Best answer by JackLacava

You are hardcoding the scenario type ID - the first parameter to GetAttributeValue, so maybe your problem is there.

Also make sure you're actually on the right workflow profile, i.e. "Houston.Import" is different from "Houston" and will not inherit Text values.

This code works:

Dim myScenarioType As ScenarioType = BRApi.Finance.Scenario.GetScenarioType(si, si.WorkflowClusterPk.ScenarioKey)
Dim myWorkflow As WorkflowProfileInfo = brapi.Workflow.Metadata.GetProfile(si, si.WorkflowClusterPk)
Dim wfText As String = myWorkflow.GetAttributeValue(myScenarioType.Id, SharedConstants.WorkflowProfileAttributeIndexes.Text1)
Dim wf1 As New NameValueFormatBuilder(wfText)
' the last bit is not very robust...
Dim myValues As String() = wf1.GetValue("GL").Split(",")

2 replies

OneStream Employee
November 8, 2022

You are hardcoding the scenario type ID - the first parameter to GetAttributeValue, so maybe your problem is there.

Also make sure you're actually on the right workflow profile, i.e. "Houston.Import" is different from "Houston" and will not inherit Text values.

This code works:

Dim myScenarioType As ScenarioType = BRApi.Finance.Scenario.GetScenarioType(si, si.WorkflowClusterPk.ScenarioKey)
Dim myWorkflow As WorkflowProfileInfo = brapi.Workflow.Metadata.GetProfile(si, si.WorkflowClusterPk)
Dim wfText As String = myWorkflow.GetAttributeValue(myScenarioType.Id, SharedConstants.WorkflowProfileAttributeIndexes.Text1)
Dim wf1 As New NameValueFormatBuilder(wfText)
' the last bit is not very robust...
Dim myValues As String() = wf1.GetValue("GL").Split(",")
sruthyAuthor
Newcomer
November 8, 2022

Thank you JackLacava that makes sense.

 

Regards,

Sruthy