The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
sfilho
3 years agoNew Contributor III
Getting the Workflow Profile Text1 attribute value using BRApi
I am trying to get the Text1 field value using a Business Rule and put this value in a cube view that is being used as Form.
Does anyone have done this before? Is it possible to get the Text1 value...
- 3 years ago
Yes it is ugly. I could not get this piece working properly:
GetAttributeValue(BRApi.Finance.Scenario.GetScenarioType(si, args.SubstVarSourceInfo.WFScenario.DimId).Id
I replaced with:
Dim wfClusterPK As WorkflowUnitClusterPk = si.WorkflowClusterPk
Dim wfScenarioTypeID As Integer = BRApi.Workflow.General.GetScenarioTypeId(si, wfClusterPK)
Dim sVarStep2 As String = BRApi.Workflow.Metadata.GetParent(si, args.SubstVarSourceInfo.WorkflowUnitInfo.ProfileName).GetAttributeValue(wfScenarioTypeID, 18000)
It brought the correctly value.
db_pdx
3 years agoValued Contributor
At least for our implementation we don't have too many distinct Form Templates so it is really only an initial setup thing in my opinion. Also, a reminder: you should be adding more Forms to the Template. Not creating new Templates for singular Forms. This way any new form they add to the Form Template will already benefit from the metadata you are adding to that step.
Back to your original question, yes, we can get at it; it is just ugly. Assuming usage in an XFBR String Business Rule
myString = BRApi.Workflow.Metadata.GetParent(si, args.SubstVarSourceInfo.WorkflowUnitInfo.ProfileName).GetAttributeValue(BRApi.Finance.Scenario.GetScenarioType(si, args.SubstVarSourceInfo.WFScenario.DimId).Id, 18000)
Where the Attribute Index is:
Text1 = 18000, Text2 = 20000, Text3 = 22000, Text4 = 24000
sfilho
3 years agoNew Contributor III
Yes it is ugly. I could not get this piece working properly:
GetAttributeValue(BRApi.Finance.Scenario.GetScenarioType(si, args.SubstVarSourceInfo.WFScenario.DimId).Id
I replaced with:
Dim wfClusterPK As WorkflowUnitClusterPk = si.WorkflowClusterPk
Dim wfScenarioTypeID As Integer = BRApi.Workflow.General.GetScenarioTypeId(si, wfClusterPK)
Dim sVarStep2 As String = BRApi.Workflow.Metadata.GetParent(si, args.SubstVarSourceInfo.WorkflowUnitInfo.ProfileName).GetAttributeValue(wfScenarioTypeID, 18000)
It brought the correctly value.
Related Content
- 1 year ago
- 4 years ago
- 2 years ago