Agent determination position/ rule

HI Gurus,
I am new in workflow. For our project we have created a org structure. Which has O-S-US.
There are only two positions Agent and Lead Agent.
If I want to send an workitem to lead-agent I can send it to the position. But as our business will be maintaining the org structure they want an option that in case if any user is not assigned to the Lead-agent it should inform the workflow initiator.
Do I have to use a rule, or how I do that Please help. Any other better way to do it?
I promise I will reward every helpful answer.
With thanks
Rabbi

I think you have to evaluate the agents by using a method. In side the method you need to check whether any agent is maintained in the Org. Unit if not you have to put WF_INITIATOR as the agent.
The method will return the agent ID(SAP User Id) concatenated with US in front.
Thanks
Arghadip

Similar Messages

  • HCM F&P:Agent determination  without Rule 17900012 .

    Hi experts,
    I am doing TRANSFER process. In my workflow , I am using Rule 17900012 for agent determination . So the workflow is executing successfully.
    Now I dont want to use that rule. Instead I tried to give the variable as the EXPRESSION for agent. But then that task is not appearing in Universal Worklist and I checked  the Workflow Log, the Wok Item is in READY status. And it is not allowing to execute the item saying 'WORK item couldnt be found.
    Is there any restriction like we should maintain the Rule 17900012 to get the task  in the UWL?

    Hi
    Try with
    Expression = &_WF_INITIATOR&
    Kind Regards,
    Mukesh

  • Agent Determination with Rule

    I have created a workflow that will send out email notifications when a sales order is created or modified.  This notification will not require user reponse, it is for informational purposes only.  I have created a rule that will import a container from my workflow, and, based on that determine which agent(s) should get the notification.
    What steps (tasks) do i need to include in my workflow to have the agents returned from the rule to my workflow and proceed to the next step without user interaction?  I have created a container for the return values but nothing seems to be getting populated (even though the ruleresult from the rule contains the correct results).
    Also, is there a standard business object/method that i can use to go along with the rule.  (Do i need to use a method along with the rule, or can i only use the rule to get my needed agents?)
    Thanks in advance.

    Hi Michel,
    If it is only a notification purpose, creating method is a good option.
    Just create a method and Populate all the Email Id's in the method and pass it to workflow.
    Then use the Container in the mail step.
    If you dont have any custom business object's then you can use the rule.
    I think you have custom business object for your process. Then just make use of it.
    Thanks.

  • Responsibility rules : Agent determination only works after restarting the WF

    Hi Experts,
    We are facing a very strange issue related to agent determination in one of our custom workflow:
    For agent determination we are using a responsibility rule with two parameters "Company code" and "Plant".
    The responsibility rule works well and returns the agents for all the company code.
    Recently I have added few company codes to this responsibility rule in the same way we used to maintain and simulate it . It returns the correct agent for newly added company codes but at run time the agent determination is getting failed and the WF goes into an error because of it. However when i restart the WF via SWPR it works well and the agent determination works well either.
    This is only happening for newly added company codes the old ones agent determination work well at the run-time.
    Pls suggest what could cause this problem. If there is a problem in responsibility rule then why it works after restarting from SWPR.
    Thanks in advance. The helpful/correct answers will be rewarded.
    Regards,
    Him

    Hi Rick,
    Thanks for replying.
    1. Can you replicate this problem in the test system?
    Yes I could replicate this issue in test system and it works fine there.
    2. Is this a true responsibility rule or does e.g. a function module get called?
    We have a responsibility where several responsibilities have been added with two parameters "company codes" and "plant". Every responsibility has a POSITION assigned into it and this position contains the related users.
    This responsibility rule is getting called in one other rule with FM. Here in this another rule we are calling the responsibility rule by using the standard FM  RH_GET_ACTORS to fill the ACTOR_TAB.
    I have tried to simulate both the rules and it returned correct agents but failing at run time.
    Regards,
    Him

  • Agent Determination Rule Not Working

    I have created an new agent determination rule in PFAC.
    The category I used is "Agent Determination: Responsibilities".
    I have also selected the "Terminate if Rule Resolution has no Result" option.
    The container has one element in it which is NOT mandatory called "Clinic".
    I have set up the responsibilities, where there is only one which catches all - In other words, I created a responsibility for Clinic "*". I have also assigned a position as a responsible agent. The position is linked to a person number, and the person has a user-name assigned - All are in the valid period.
    If I test the rule, and do not enter anything for the Clinic, and click the test button, it returns my one agent, which is correct.
    The problem is that in my workflow I have assigned the rule as a responsible agent. At runtime, the workflow falls over saying that the agent determination has failed. This does not make sense, since I have not passed anything in binding to the rule. As mentioned earlier, when testing it works fine. I have tried using the rule with and without binding but it wont work. If I change the step in the workflow to rather use  position, it works.
    Please let me know if you have any ideas - I am really battling with this strange problem.

    I tried deselecting "Terminate if Rule Resolution has no Result" in the rule definition.
    Having done that, the workflow now works correctly - It actually DOES find an agent and the workflow goes on as expected.
    This is really weird, because if the terminate option is selected, it falls over saying that no person was found. Now with the terminate option not selected, it finds the agent - Is this a bug, or am I misunderstanding something???

  • Error in resolution of rule ... for step - Agent determination failed

    Dear All,
    In SRM 7.0 CS, i am having a problem in the area of work flow. In general, the workflow is working fine, but at times the work item does not get delivered to the approver.
    As per the analysis from SWI2_DIAG, the error is the following for the concerned shopping carts:
    Error handling for work item 000000056146
    No links corresponding to the specified data could be determined
    Error in resolution of rule 'AC40000138' for step '0000000293'
    Agent determination for step '0000000293' failed
    Error during result processing of work item 000000056156
    Error when processing node '0000000293' (ParForEach index 000000)
    Error when creating a component of type 'Step'
    Error when creating a work item
    Error when processing node '0000000293' (ParForEach index 000000)
    Work item 000000056155: Object FLOWITEM method EXECUTE cannot be executed
    Error handling for work item 000000056154
    Error when processing node '0000000293' (ParForEach index 000000)
    Does anyone have an idea on the root cause of this error?
    Thank you very much.

    Hi Masa,
    thank you very much for the reply.
    Yes, rolewise the approver is having the manager role in SRM and also on the portal. But what do you mean by "manager position in PPOSA_BBP"?
    The user is hanging in his node together with the other users. Is there any specific "manager position", where the approvers have to be put in PPOMA? I mean, the other approvers, for whom the workflow is working normal, are hangig in their nodes just like the approver who is not getting the work item.
    Moreover, if i drag the users (the requestor and the approver) into an other node (for another plant of another company code for example), than the work flow is working fine.
    Can there be any other reason for such an error?
    Thank you very much.

  • Error in resolution of rule ... for step - Agent determination for failed

    Dear Experts,
    in SRM 7.0 CS, i have come accross the following workflow error:
    I have extended my existing organizational plan for a new site (new CoCo, Plant, Purch Org and Purch Gr). But when i use my test users with this site, i receive a workflow error, that has the following wording in SWI2_DIAG:
    Error handling for work item 000000055347
    No links corresponding to the specified data could be determined
    Error in resolution of rule 'AC40000138' for step '0000000293'
    Agent determination for step '0000000293' failed
    Error during result processing of work item 000000055357
    Error when processing node '0000000293' (ParForEach index 000000)
    Error when creating a component of type 'Step'
    Error when creating a work item
    Error when processing node '0000000293' (ParForEach index 000000)
    Work item 000000055356: Object FLOWITEM method EXECUTE cannot be executed
    Error handling for work item 000000055355
    Can you maybe help me understand, what this error means and how to resolve it?
    Thank you very much!
    P.S. my test users work fine if i drag them to another location in my organizational plan. And also if i take other test user from locations where everything works fine and drag them to this "problem" location, than the same workflow error occures.

    Remove the user from the PPOMA node and add him again.. Sometimes this will solve the issue..
    Thanks!!
    Bharath

  • Agent Determination Rule using Function Module

    Hi all,
    I am trying to create a custom agent determination rule using function module. But my rule is not getting invoked when the workflow is executed.
    I created a custom rule and linked my function module (with proper signature).
    FUNCTION 'ZRULEXXX''
    ""Local Interface:
    *"  TABLES
    *"      AC_CONTAINER STRUCTURE  SWCONT
    *"      ACTOR_TAB STRUCTURE  SWHACTOR
    *"  EXCEPTIONS
    *"      NOBODY_FOUND
    And I am hard coding some values into table ACTOR_TAB
    REFRESH ACTOR_TAB.
    CLEAR ACTOR_TAB.
    IF SY-SUBRC NE 0.
        RAISE NOBODY_FOUND.
      ELSE.
        ACTOR_TAB-OTYPE = 'US'.
        ACTOR_TAB-OBJID = 'XXXX'.
        APPEND ACTOR_TAB.
        ACTOR_TAB-OTYPE = 'US'.
        ACTOR_TAB-OBJID = 'XXXXXX'.
        APPEND ACTOR_TAB.
      ENDIF.
    But a worklist item is not being created for the users appended to ACTOR_TAB.
    Is there anything am missing. Please let me know.
    Thanks in advance
    Regards
    Raju

    Hi,
    Change it to following code. It will work.
    REFRESH ACTOR_TAB.
    CLEAR ACTOR_TAB.
    *IF SY-SUBRC NE 0.
    *RAISE NOBODY_FOUND.
    *ELSE.
    ACTOR_TAB-OTYPE = 'US'.
    ACTOR_TAB-OBJID = 'XXXX'.
    APPEND ACTOR_TAB.
    ACTOR_TAB-OTYPE = 'US'.
    ACTOR_TAB-OBJID = 'XXXXXX'.
    APPEND ACTOR_TAB.
    *ENDIF.
    Regards,
    Vaishali.

  • Agent Determination using a Rule

    Hi All,
    I tried finding related threads, but was not able to find anything that exactly matches this issue.
    I have an Activity type task to which I have assigne a rule for agent determination. I am assigning the SAP userid to the actor_tab in the function module. This is the code I am using:
      ACTOR_TAB-OTYPE = 'US'.
      ACTOR_TAB-OBJID = 'AJOHN'.
      APPEND ACTOR_TAB.
    But, when I try to simulate the rule in PFAC, it says "no agent found". What am I doing wrong?

    I created a function module called ztest_rule in se37 and put your exact code.  I then created a rule called ztest_rule in PFAC and chose Agent Determination: Function to be executed and entered ztest_rule as my function module.  When I hit the little abacus and then the wrench in PFAC to test, it returns  US  AJOHN.

  • Function Module Interface for Agent Determination Rule without Tables Param

    Hi,
    I'm currently trying to create an agent determination rule using a custom function module. I know that the function module must have a certain interface consisting of two table parameters to be accepted by the system.
    But since table parameters are obsolete for a few years, what's the solution for this?
    As workaround, I just copied an old function module with the right interface but that's not an ideal solution for me.
    Did anyone else come across this?
    Thanks and regards,
    Max

    Hello,
    "I know that the function module must have a certain interface consisting of two table parameters to be accepted by the system."
    So, you have to use tables. You can't use tables in a new function, but you can copy one that does.
    What sort of "solution" did you have in mind?
    regards
    Rick Bakker
    hanabi technology

  • Reg. Agent Determination Rules

    Hi Experts,
               Could you please let me know the Work Flow (Standard Work Flow) in which they have used the Agent Determination Rules. Also I need the steps that we need to follow after the creation of Rules that is How\where to Assign the it in Work Flow.
    Thanks in Advance.
    Regards,
    Senthil N S

    Hi Senthil,
    Check this link <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/95/ed94ee764c11d3b535006094b9c9b4/frameset.htm">Rules - Agent Determination</a>.
    Regards
    <i><b>Raja Sekhar</b></i>

  • FM/Code to retrieve agent from Rule (Agent Determination: Responsibitlites)

    Hi All,
    I have a requirement to pick agents from a Rule (Agent Determination: Responsibitlites).
    I would like to select the agent, for the respective conditions (as defined in its Container). If there is NO RESULT (no user assigned), I would like to add in WF admin rather than returning NO AGENT.
    I am looking for any FM or some code which will help me search this rule and picks the relevant agents.
    If there is no agent determined I will then determine WF admins and add to it.
    (This way I can send the workitem to WF admin than  to allow the rule terminate in error -  when there is NO Result)
    (Terminate If Rule Resolution Without Result is checked)
    Kindly guide me on this.
    Thanks
    VJ

    Check this code
    Here DOCUMENT_STATUS is Container Element name in Rule and doc_stat is its value
    data:I_ACTOR_TAB like SWHACTOR occurs 10,
    I_ACTOR_CONTAINER LIKE SWCONT OCCURS 10.
    PERFORM SET_ACTOR_CONTAINER USING 'DOCUMENT_STATUS' doc_stat.
    FORM SET_ACTOR_CONTAINER  USING    P_NAME
                                        P_VALUE.
    DATA: L_WA_ACTOR_CONTAINER LIKE SWCONT.
    Set the container element to pass to the RH_GET_ACTORS function module
    CLEAR L_WA_ACTOR_CONTAINER.
    L_WA_ACTOR_CONTAINER-ELEMENT = P_NAME.
    L_WA_ACTOR_CONTAINER-VALUE = P_VALUE.
    APPEND L_WA_ACTOR_CONTAINER TO I_ACTOR_CONTAINER.
    ENDFORM.                    " SET_ACTOR_CONTAINER
    CALL FUNCTION 'RH_GET_ACTORS'
      EXPORTING
        act_object                      = L_act_object
      ACT_TASK                        =
      ACT_WI_ID                       =
      ACT_PLVAR                       =
      SEARCH_DATE                     = SY-DATUM
      ACTOR_CONTAINER_OO              =
      tables
       ACTOR_CONTAINER                 = I_ACTOR_CONTAINER
      EXCLUDED_AGENTS                 =
        actor_tab                       = I_ACTOR_TAB
      ERROR_TAB                       =
    EXCEPTIONS
       NO_ACTIVE_PLVAR                 = 1
       NO_ACTOR_FOUND                  = 2
       EXCEPTION_OF_ROLE_RAISED        = 3
       NO_VALID_AGENT_DETERMINED       = 4
       NO_CONTAINER                    = 5
       OTHERS                          = 6
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    thanks
    Arghadip

  • How to evaluate workflow rule for agent determination

    Dear All:
    It seems there are several types of rules that can be used for agent determination. I am wondering how could I evaluate the rule in coding.
    I know for the rule described by a function module, it would be easy to evaluate it because you simply need to call the function module. However, for others, you might have to call the rule according to its definition. Is there a generic method/function to evaluate it?
    Thanks & Best Regards,
    Haifeng Hu

    Hello,
    fm RH_GET_ACTORS
    regards
    Rick Bakker
    hanabi technology

  • Agent determination issue in a workflow

    Greetings everyone!
    I'm configuring some business scenario with the help of a business workflow in SAP CRM 7.0 I'm using activity step and want to determine agents using standard SAP rule 10000162 ("Employees for responsible org. unit"). I've tested the rule outside of the workflow and it's working fine, but  in workflow it fails to determine an agent.
    In a log I see following errors:
    Agent determination for step '0000000023' failed;
    Result of agent resolution does not agree with agents of task;
    I've made some tests depending on what assignment task has:
    1. When it is a general task, work item was created for a workflow initiator even though rule failed to determine an agent.
    2. When it is a task with general forwarding with assigned position(s), which rule will never determine, work item was created for holder(s) of that position(s).
    3. When it is a task with general forwarding with no assignments, workflow could not determine an agent as expected.
    I've also debugged functional module for that rule and it determines appropriate agent but then do some check with the help of RH_TASK_AGENT_CHECK function and returns an error.
    Can someone help me with this problem? Is it some standard expected behavior or not?
    Maybe something wrong with the org. plan?
    All answers are appreciated.
    Thanks in advance,
    Alex.

    Hello Rick and Eddie.
    I've tried to assign user directly instead of position to a task with no help. I get the same result.
    I've tried to set a task as a general task and made the rule to fail if there is no resolution and it fails.
    I've tried to assign position or user directly to activity in a workflow and it does work but that's not what I need in my scenario.
    As I said earlier I've tried to debug that rule invoked from a workflow. I will post some screenshots for you.
    I set a task as a general task and assigned rule 10000162 (ABBR="PARTNER_1", Name="Employees for responsible org. unit") to activity step in a workflow and here is what I get:
    1. Function CRM_ORGMAN_ORGOBJECTS_FIND_2 gets called by the rule and resp. sales org. unit is passed there ([screenshot1|http://www.picdrop.net/?v=debug1.png])
    2. Next function CRM_ORGUNIT_GETEMPLOYEES gets called passing id of a resp. sales org.unit without a type.
    3. Next RH_STRUC_GET gets called and returns result table with position and central person for that position ([screenshot2|http://www.picdrop.net/?v=debug2.png])
    4. In the end of CRM_ORGMAN_ORGOBJECTS_FIND_2 function only central person in inserted to the actor_tab ([screenshot3|http://www.picdrop.net/?v=debug3.png])
    5. After CRM_ORGMAN_ORGOBJECTS_FIND_2 ends we appear in a RH_GET_ACTORS function where we can see that agent check is performed if act_task is not initial. I assume that check is not performed if we do a simulation of a rule ([screenshot4|http://www.picdrop.net/?v=debug4.png])
    6. Then RH_TASK_AGENT_CHECK function gets called for every record in a actor_tab. In out particular case it's one record. ([screenshot5|http://www.picdrop.net/?v=debug5.png])
    7. Inside that function checks act_wi_id (activity work item id?) if it's initial and get exluded agents. It is initial in my case ([screenshot6|http://www.picdrop.net/?v=debug6.png])
    8. Then function tries to read table with keys equal to type and id of found agent and errors there, perhaps because there is no record in that table ([screenshot7|http://www.picdrop.net/?v=debug7.png])
    That error results in overall agent determination failure.
    Hope this screenshots will help to identify a problem.
    Why read table results in an error and because of that all rule fails?
    Regards,
    Alex.

  • Agent determination best practices

    Hi, workflow dev team!
    Another question about workflow best practices.
    I build a workflow, the first step of each workflow, at least as I see it, is to determine agents for all steps in the workflow and store it in multiline WF-container. After that, to use this WF-container data to execute a step inside of workflow.
    The questions are:
    1. Suppose, I filled a WF-container with a list of all possible agents and their position (in order to supply more user-friendly approve/decline notifications) for the different steps inside of this workflow (username & position). As I understand, I can access to specific line of multiline container with &AGENTS[&INDEX&]& inside of EXPRESSION field (not via ABAP-code in method of class), but how can I access specific column of the WF-container? E.g. &AGENTS[1]& will return «USJOHN — Junior Manager», is it possible to retrieve username and position from multi line and pass it to the task as two separate container elements?
    2. Is it possible to query specific line of multiline container element according to some logical condition inside of EXPRESSION field (not via ABAP-code in method of class) or in order to do this I have to implement that logic inside of ABAP class method?
    And the last question, probably, less connected to the questions asked above.
    3. If I need to define agents for the task, what is the best approach to do that:
    — define the task as General Task and insert the relevant agents as multiline container element via EXPRESSION field;
    — to play with Agent Assignment (try to implement agent determination logic there) and not to define the task as general one.
    Thanks.

    Ronen already had great input, but here are some additional points:
    -In general I would try to avoid some kind of "Let's get all the agents at the beginning of the workflow into a multiline container, and try to pick up the correct ones for the individual steps" approach. Of course if your aim is just to display the list of agents somewhere (task description etc.,), then this might be OK approach.
    -Rules are better than expressions in agent determination (at least in most cases). If the approvers change during the process, you can (as an WF admin) just click the "Execute agent rule again" functionality, and the system will find the correct new approver for the work item. Otherwise you need to go to manipulate the container element(s) (and first figure out that who is the approver).
    Answer for 3: You don't need to use only expressions/container elements. Try to check if you can use rules. In some rare cases you might consider of using the tasks' agent assignment (the same place where you set the task as general task). Let's say that you want to send the work item to all users that have certain authorization role. Now you can set the role as a "restricting entity" at the task level (=same place where you set the general task). This will mean that only the users who have the role are the possible agents for the task. And now if you leave the agent determination part at the workflow template empty (no expressions, no rules etc), you are done!
    Regards,
    Karri

Maybe you are looking for

  • List sql backups in a folder then restore the selected backup to the selected database

    Hi I'm created a script that lists the backups in a folder then allows user input to select a backup. It then needs to list the sql database on a specific server and accepts user input. I can list the backups as follows $Dir = get-childitem $CurDir -

  • Anyone get a 6G replacement for a 1G in any color but silver?

    Just wondering if anyone who has received a refurb or new 6G nano as a replacement for their 1G nano has gotten anythiing but the boring silver color?  I will probably never use mine, but I was curious because every message I have read has indicated

  • Adobe QT32 Server ( ne réponds pas ) ?

    Bonjour à tous, J'ai déjà publier sur ce forum et ça toujours été utile pour moi. Depuis deux jours, il m'a aussi permis de remédier à de gros soucis, je me permet donc de faire un point avec vous sur les problèmes que j'ai eu bien qu'ils soientt rés

  • TreeControl & Grid Control

    Q1 TreeControl I have this TreeControl in the frame along with several TextFieldContrl, GridControl My application can only play once (run once) for the frame with tree control each time I run it. It display OK in the first run. If I pay the 2nd visi

  • Can't install - serial number refused

    I am trying to install Aperture 1.5 for the first time, but my serial number is being refused. Of course I entered it perfectly (several times), following the instructions in the manual. I did, due to pressure of work, wait a few months after buying