Assistance Needed: Updating "Profile Active" Property via Extender Rule

manthangandhi
New Contributor III

 

Dear Team,

I am currently working on updating the "Profile Active" property for a specific scenario type within a workflow profile. I am trying to implement this change using the below code snippet, but am not seeing the desired result:

code snippet:

brapi.Workflow.Metadata.GetProfile(si, "Parent Profile.Profile Name").SetAttributeValue(ScenarioType.Control.Id, 1300, Boolean.TrueString)

Though I am aware that this update can be performed manually by accessing individual workflow profiles or using the grid view, my requirement is to execute this task through an extender rule.

I've identified that the attribute index for "Profile Active" is 1300 and the value to be updated is of an object type. I suspect there may be an issue with the way I'm passing the new value in the code.

I would appreciate any guidance or insight on how to correctly update this property using the extender rule.

Your assistance is greatly appreciated.

Thanks

 

5 REPLIES 5

FredLucas
New Contributor III

Hi, 

The SetAttributeValue function only updates the settings temporarily, it does not store them in the database.

There's an open enhancement request asking for a way to have these updates committed to the database.

In the meantime, although fairly complex, a workaround solution for it would be to automate the production and load of an xml file containing the attribute values you are looking for.

Regards,

Fred

 

Hi Fred,

Is there any alternate way to perform this usinng database, anyclue on this?

@manthangandhi  - You can try with the WFText1 value. This could be workaround vs updating the table directly. My 2 Cents. I am not sure about the complete use case, trying to put some ideas.

1. Create a Extender BR to populate the text1 Value of the WF profile.

2. Ignore the WF Profile in your BR based on the Text1 value.

 

Thanks
Krishna

The properties are all there in the WorkflowProfileAttributes table... You might get some frowns from updating it on here but if its working around a bug then maybe it is the best way. You might need to run the setAttributeValue as well if that command is doing an in-memory/cache update as your DB table change might not be visible to clients (and perhaps even get overwritten? not sure).

DanielWillis
Contributor III

DanielWillis_0-1715295742454.png

I'm not sure you're passing the right parameter in the first position. What is ScenarioType.Control.Id supposed to be?

If it is a specific scenario type you know ahead of time then you could use something like ScenarioTypeId.Budget.

Otherwise one of the methods to obtain the scenariotypeid from current wf/global/wherever, e.g. brapi.Workflow.General.GetScenarioTypeId(...)

 

 

Please sign in! manthangandhi