Assign only 1 business role as part of acctDef

Hello,

We have an accountdefinition that has 2 business roles assigned to it. However, based on the selection on WebUI form field, we want to assign only 1 business role and not the other. Below is an example

Form field

username

ERole (acctDef name) - DS

criteria (drop down field)- CA, GS

AcctDef DS in backend is configured to have 2 business roles DS-GA and DS-GS

When a user submits the form to have DS and crieria CA, user should be assigned only DS-GA business role through the acctdef and not DS-GS. How can this be accomplished

Thanks in advance