This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multiple approvers in single Step

Hey Community,

We are creating an approval workflow and areusing the CP step on one level. The requirement is that we have to send this approval request to the people that have been input by the user on the web portal (IT Shop) form. There are three UID_Person fields on the form - Primary, Secondary and Additional Owner. The approval workflow should be sent to all 3 people at the same approval level.

Now the approval workflow has been attached to an approval procedure and all the owner values are put in ObjectKey1, ObjectKey2 and ObjectKey3 in attestation case.

Currently the approval workflow only sends to ObjectKey1 using the query:

select ObjectKey1 as UID_Person from AttestationCase where UID_Attestationcase = 'V_UID_Attestationcase'

To incorporate 3 at the same level, I tried adding a UNION to attach 2 more queries with ObjectKey2 and ObjectKey3 but that doesn't work.

I cannot add another CP step to the same level which I initially planned on doing.

Any help would be greatly appreciated.

Thanks
Sachin

  • Hi Sachin,

    Using OR is likely the easiest (though not most elegant) path since you need UID in a list of 3

    Select UID_Person 

    From Person

    Where

    UID_Person = (Select ObjectKey1 from AttestationCase where... )

    or

    UID_Person = (Select ObjectKey2... )

    or

    UID_Person = (Select ObjectKey3 ... )

  • Hey Aaron,

    I tried the following:

    select uid_person from person where uid_person = (select ObjectKey1 as UID_Person from AttestationCase where UID_Attestationcase= 'V_UID_Attestationcase') or uid_person = (select ObjectKey2 as UID_Person from AttestationCase where UID_Attestationcase = 'V_UID_Attestationcase') or uid_person = (select ObjectKey3 as UID_Person from AttestationCase where UID_Attestationcase = 'V_UID_Attestationcase')

    But when the approval workflow was getting created it aborted with this message:

    "#LDS#Approval decided by the system, no approver available."

    Am I doing something wrong in this query?

    Thanks
    Sachin

  • What data is stored in the ObjectKEy1/2/3? 

    Is it the UID  (i.e.    000aaff5-380d-4433-832a-a2f590a0b574  )  

    or is it the Key  (i.e.    <Key><T>Person</T><P>000aaff5-380d-4433-832a-a2f590a0b574</P></Key>  )

    If it is the key change your lines to be:

    XObjectKey = (Select ObjectKey1 ...)

    Sorry about that, I should have waited until after coffee to answer questions. 

  • Yes its the UID only. Below is what I have:

    ObjectKey1: $FK(CCC_SA_PrimaryOwner).UID_Person$

    ObjectKey2: $FK(CCC_SA_SecondaryOwner).UID_Person$

    ObjectKey3: $FK(CCC_SA_AdditionalOwner).UID_Person$

    CCC_SA_PrimaryOwner is a UID itself so I am not sure if I even need the FK(CCC_SA_PrimaryOwner).UID_Person$ but this is giving the same value as well anyways.

    The query I posted works perfectly in SQL developer when I replace the V_UID_AttestationCase variable with an actual UID_AttestationCase value and returns the 3 owners that were input during account request.

    I have tried changing the number of approvers value to 3 as well.

    Thanks
    Sachin

  • I think I see the issue. 

    In the query you posted you have:   'V_UID_Attestationcase'  

    By putting that in single quote you are turning it into a literal string. You should be referencing the variable instead. That variable is probably already exposed to you. 

    Going from an example of something we currently have in production use:  

    where UID_AttestationCase = '@UID_AttestationCase' 

    Quick note:  Setting the number of approvers to 3 means that 3 people would need to approve it to pass this step.

    Here is the similar personwantsorg CP rule. The function is different but the important part is how we are referencing the PWO that we are working with, You should be able to use a similar method to reference the AttestationCase you are workign with

  • I believe your back end is a SQL database. We have an Oracle database and the variable used in Oracle is 'V_UID_Attestationcase' and not @UID_Attestationcase

    When I have a single query like select objectkey1 as uid_person from attestationcase where uid_attestationcase='V_UID_Attestationcase' then it runs just fine.

    Thanks
    Sachin

  • Not sure if it will help, but I've faced similar issues in Oracle in the past which was resolved by using 'v_uid_AttestationCase' (note the exact case)

    Worth a shot!

  • I tried the exact case you mentioned but no success.

    Again when I use:

    select uid_person from person where uid_person = (select ObjectKey1 as UID_Person from AttestationCase where UID_Attestationcase= 'v_uid_AttestationCase')
    or uid_person = (select ObjectKey2 as UID_Person from AttestationCase where UID_Attestationcase = 'v_uid_AttestationCase')
    or uid_person = (select ObjectKey3 as UID_Person from AttestationCase where UID_Attestationcase = 'v_uid_AttestationCase')

    It doesn't work. However when its just a single select statement (regardless of what the case is of V_UID_AttestationCase variable) it still works.

    Thanks
    Sachin

  • I need to put another check at the start now. This is a CD step. If the requester of the account is the same as the Owner then the request should directly go to the next level.

    I have this condition in the CD step:

    exists(select 1 from attestationcase where ObjectKey1=PropertyInfo1 and uid_attestationcase='v_uid_AttestationCase')

    PropertyInfo1 value is the Requestor value and ObjectKey1 is the owner value. Now this works in SQL developer when I replace the uid_attestationcase with a value but doesn't work with v_uid_attestationcase.

    Any suggestions?

  • should work - suggest opening a support case