Unable to change certification state

Kamila
New Contributor III

Hi Team,

 

I have tried to make a simple task - if user in not in group I would like to change a certification status to rejected.

This code is in DataQualityEventHandler:

Case Is = BREventOperationType.DataQuality.Certify.FinalizeSetQuestionairreState
Dim sGuid As String = "419eeb3d-eaec-43fc-bc0a-cab5862323f10"
Dim Guid_1 As New Guid(sGuid)

If BRApi.Security.Authorization.IsUserInGroup(si, si.UserName, "GROUP",False) = False Then

BRApi.DataQuality.Process.ExecuteQuestionnaireSignOff(si,si.WorkflowClusterPk,Guid_1,CertSignOffStates.ProfileRejected,"Comments")

End If

 

It always returns "Certified", but should "Rejected":

Kamila_0-1687346464792.png

 

 

Any ideas what am I missing?

4 REPLIES 4

MikeG
Contributor III

Hi @Kamila , I think you are over-thinking the process.  I would create a Security Group for that Certification Step.  In the Workflow Profile editor page assign only those users you want to be able to complete the Certification step, access to do just that.  It would look like this:

MikeG_0-1687352489686.png

Note the Prefix WFA - for Workflow Access, WFE for Workflow Execution, and WFC for Certification Signoff.  Then you don't need a BR to reject it.  You can have users manage the Certification Step using Security Groups assigned here on the Workflow Profile Editor page.

 

Hope this helps.

 

Kamila
New Contributor III

Hi Mike, thanks for your reply.

I know this method looks like reinventing the wheel, but it's because of the incorrectly set workflow groups. Workflow Execttion Group contain the Certification and I'm not able to separate them (as this require the whole workflow rebuild).

My idea was to do the check in BR, because I can't find another solution

MikeG
Contributor III

I would do the inevitable, unravel the Security groups.  Take the Certification Group out of the Execution Group.  Assign the WFC_* group explicitly to the Certification SignOff Group on the workflow.  Understandably it may be a daunting manual task but the people who inherit the Administration and Maintenance of the application you are building will thank you later.

Kamila
New Contributor III

Thanks Mike, but the rebuilt of workflow will be the bigger project in the upcoming months and now I need kind of a workaround like a BR