Skip to Content
avatar image
Former Member

How to assign Action to multiple Users dynamically in GP

Hello Experts,

I have the following scenario in GP

I have created a Web Dynro GP Callable Object and from my Web Dynpro i need to a pass a list of Users to which a particular Action needs to be assigned.

I am able to return a single value from web dynpro to gp.

Can some one help me how to return a list of users to gp.

I have done the following: In the getDescription method I have added an attribute of multiplicity 1_N:

IGPStructureInfo outputStruct = technicalDescription.getOutputStructureInfo();

IGPAttributeInfo list1 = outputStruct.addAttribute("List1", IGPAttributeInfo.BASE_STRING);

list1.setMultiplicity(IGPAttributeInfo.MULITIPLICITY_1_N);

then in the complete method I am trying to set an Arraylist to this variable:

IGPStructure output = execContext.getOutputStructure();

output.setAttributeValue("List1", userList);

Here userList is an Arraylist which contains the list of User Id's..

However I get the following exception:

com.sap.caf.eu.gp.exception.api.GPInvocationException: Multiplicity of attribute with name List1 and namespace null does not allow single values to be set/received

at com.sap.caf.eu.gp.structure.impl.GPStructure.setAttributeValue(GPStructure.java:114)

Can someone help me in knowing how I can return a list as an output parameter to GP from Web Dynpro...

Regards

Sundeep

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 03, 2008 at 11:49 AM

    Hi Sundeep,

    Please check whether the output parameter of the webdynpro component at action is exposed as a List. For doing this check whether is List is checked at action level.

    Hope it helps you.

    Regards,

    Srinivasan Subbiah

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sundeep.

      Could you please help me in in my issue.

      In my scenario we need to send a request to list of people dynamically and all the people in the group has to complete the Approval.

      I am using following structure:

      Process

      Sequential Block

      Action 1

      Parallel Dynamic Block

      Sequential Sub Block

      Action 2.

      I am having a context value in Employee(Value Node)->Name(Value attribute).

      Employee(value node) size is more than 1 .

      I need to pass Name (Value attribute) to the block processor of action so that list of people will get tasks..

      1)How can we pass list of people through context parameter in the block through webdynpro coding.

      2)when can we know that tasks sent to list of people are completed?

      3)This is the rite way of approach?

      Please suggest me the rite way of approach.

      Regards,

      Rajesh.

  • avatar image
    Former Member
    Sep 02, 2008 at 01:29 PM

    Hi Sundeep,

    You have to use

    output.setAttributeValues();

    if you are setting any collections value and not setAttributeValue().

    Hope it helps you.

    Regards,

    Srinivasan Subbiah

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Srinivasan ,

      Thanks a lot for your reply, it did solve part of my problem..

      But still if i monitor the GP Process in the NWA the number of processosors for the action is still one..

      I will try to explain you..

      In my List that I am returning I have two User Id's which I can see in the User_List input parameter of the Assign_User_to_Process_Role Callable Object in the

      Guidied Procedure Monitoring..

      USER.PRIVATE_DATASOURCE.un:S15_0137EF03

      USER.PRIVATE_DATASOURCE.un:S15_0140EF01

      However only the first User Id is being set as the Processor of the Action.

      In the Design time I have mapped the List with the User Identifier parameter of the Assign_User_to_Process_Role Callable Object ...

      Can you suggest why even though two values of the User Id are being returned to GP only one of them is actually getting mapped...

      I hope even for multiple assignments the Assign_User_to_Process_Role Callable Object is to be used..

      Many thanks for your help in advance...

      Regards

      Sundeep

  • avatar image
    Former Member
    Sep 02, 2008 at 01:39 PM

    hi,

    U are trying to set a list to the String and this is the reason for the exception .

    do it in this way :

    In the description method :

    IGPStructureInfo inputStructureInfo = inputStructureInfo

    .addStructure(wdContext.nodePatentDetail().getNodeInfo()

    .getName());

    inputStructureInfo .setMultiplicity(IGPStructureInfo.MULITIPLICITY_1_1);

    inputPatentDetailsStructureInfo.addAttribute(

    "User", IGPAttributeInfo.BASE_STRING);

    Suppose u have a node say : InventorResult

    and this node has the UserId List.

    So in the complete method :

    for (int i = 0; i < wdContext.nodeInventorResult().size(); i++) {

    IInventorResultElement inventorResultElement = wdContext.nodeInventorResult()

    .getInventorResultElementAt(i);

    IGPStructure outputInventorResultStructure = outputStructure

    .addStructure(wdContext.nodeInventorResult()

    .getNodeInfo().getName());

    outputInventorResultStructure.setAttributeValue(

    "User",

    inventorResultElement.getEmployeeCode());

    }

    Thanks and Regards

    Add comment
    10|10000 characters needed characters exceeded