Skip to Content
avatar image
Former Member

Workflow conceptual -doubts

hello,

few doubts on workflows,

i am executing a workflow from a program using FM :'SWW_WI_START'.

i am passing agent table in this FM as a parameter.

But in workflow also i have created an activity and maintained agent assignement in task.

What i am not understanding is:

Does workflow sends workitems to those agents which i am passing while calling FM

or does workflow send notifications to agents in have maintained in agents in workflow (control tab).

1 once i have not assigned any agent in control tab and also agent table (passed to FM) is also empty.

Still why i am getting notifications in SBWP for that work item?

s2.jpg (29.0 kB)
s1.jpg (47.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 09, 2015 at 01:49 AM

    Just as Rick, I would use SAP_WAPI function. You can pick SAP_WAPI_START_WORKFLOW, because you are already using a similar function to start the workflow directly. Then use the container parameter  of the function to pass the agents to the workflow. For example create a new container element called AGENT to the workflow container (change its properties to "import"). Now pass the agents with SAP_WAPI_START_WORKFLOW to this new container element. Use that container element as your step's agent (I can see from your screenshot that currently its empty).


    Regards,

    Karri

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Your approach of using the expressions is correct.

      This thread has become a one-on-one teaching session. I recommend that you close this thread and continue your learning process by trying to search answers by yourself. If and when you cannot solve certain specific problem, you can create a new thread.

      Thanks,

      Karri

  • Jan 08, 2015 at 01:02 PM

    Hi,

    The FM you used and passed AGENT is refer to the  workflow agent , not TASK agent(2nd screenshot).  If you not maintinating any agent in control tab and   make the TASK    as

          general task, every user in the system   will get         the workitem.

    Check and share screnshot of runtime workflow log

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      okay. thanks,

      How would i be able to send the work item to multiple agents . Should i pass multiple receipients in FM.(workflow agents) or should i create a container element(multiline) and then pass it in control tab in TASK.

      Or should i create a rule to determine agents(FM to determine agents).

  • avatar image
    Former Member
    Jan 08, 2015 at 10:07 PM

    Hello,

    You should not be using fm SWW_WI_START. Use SAP_WAPI_START_WORKFLOW if you have to, but best of all would be to use SAP_WAPI_CREATE_EVENT to create an event to trigger the workflow.

    regards

    Rick Bakker.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Rob Dielemans

      Further to what Rob said - SAP_WAPI* is guaranteed to work after the next upgrade while SWW* can be changed at any time by SAP, causing your application to fail.

      If you want to really do it properly, use SAP_WAPI_CREATE_EVENT. Surely your workflow has a main class or BOR object.