cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Expression in task step

Former Member
0 Likes
3,411

Dear Experts,

I have a block step. In dynamic processing tab of block step i have given a multi line element with name "agents". I have set the initial value of multi line element as 3 user id. I want to send work item to all user ids specified in the multi line element. Inside block step i have placed an activity step. In task of activity step i specify agent as "expression" and its value as "&_AGENTS_LINE&". When I execute the workflow I expect the workflow to send work item to all users i have given as initial value in multiline element. Also I have made the task as general task under attributes. In swi1 when i get the task step with status ready. when i click agents button there its displaying message as "No selected agents". Kindly help me with this problem.

Regards,

Bharath

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hello Bharath,

I have created a simple workflow pattern having a block using "ParForEach" on a multi-line element AGENTS based on the type WFSYST-AGENT. Using the element &_AGENTS_LINE& seems to be correct, as this is what the standard generates for you within the local block container.

However I have found out, that you still need to make a binding from the multi-line element AGENTS to your single line. This is done at the tab "Control" of the Block and the binding must be:


Binding from Workflow to Block at the section "Control"

&AGENTS[&_WF_PARFOREACH_INDEX&]&  ==>  &_AGENTS_LINE&

Otherwise the element &_AGENTS_LINE& is left empty and there're no agents found for the task.

Best wishes,

Florin

Former Member
0 Likes

Dear Florin,

Thanks a lot for your reply. I have cleared using SWU_OBUF. Also as you have said i checked the binding, its perfectly as you have said. I do not know why still the problem persists as all experts replies are present in my workflow. Is there any other thing i am missing out? Kindly help me out.

Regards,

Bharath

Former Member
0 Likes

(something might have went wrong with the text markup. I have some browser problem).

Hello again,

I have logged all the steps that I've needed to do in order to create a very simple par-for-each block and get this workitem. I would advice, that you create this test-pattern first, so that you can compare any mistakes with that (working) pattern here:

HOWTO create a simple par-for-each block

- Call transaction PFTC and create a new workflow pattern, give it an abbreviation and a title, then save your data (no workflow designed yet)

- Call the workflow builder "Button: Workflow builder" at the basic data screen of transaction PFTC.

- Create new element in workflow container AGENTS, with Abap-dic. reference to WFSYST / AGENT, Properties: "Multiline" on

- Add 3 new container operations at the beginning of the (empty) workflow pattern: Add Agent, Result Element = Agents, - Assignment = "<-" (add only to table), Expression = US<userID>. In one container operation, use your own user-ID, in the two others use any other valid user-ID.

- Activate the workflow pattern

- Make the workflow pattern starteable by your user-id. Go to "Goto->Basic Data", "Goto->Agent assignments for task", Make the workflow task a "General task" using the Attributes-Button.

- Test the workflow: Use Workflow->Test (or the F8-button). Push button "Refresh organizational environment". Enter your new workflow task id here: WS9..... and press the execute-button. The button "Workflow log" will no become active. Press this button. The workflow log looks a bit "empty". Click on the first line of the log and navigate to the work-item to check the workflow container (this way is a little bit different from every R/3 release, so you have to check out yourself here). Basically it's at the end Goto->Technical Workitem display, then "Extras->Container". The dialog "Display Container instance" must now show an element "Agents" and on the right hand side of it you have to see: "< 3 Entries >". Click on the element's name and all three user-IDs (including a leading US) are now listed. If not, there's something wrong with the container element definition or the operations on it.

- Now having ensured that the container element holds more or less meaningful data we create the par-for-each block, based on this element.

- Go back, until you reach the workflow builder graphical screen again.

- Position the cursor at the outcome of the last container operation and create a new step. Choose "Block". Step-name: "Par for each Agent". Block type "Par for each". Choose tab "Parallel Processing". Multiline Element = AGENTS. Press enter. A new nice icon should appear now at the tab strip's header, indicating that it is active. Go back to "Control tab" and create a binding from "Workflow" to "Step 'Par for each Agent'" &AGENTS[&_WF_PARFOREACH_INDEX&]& -> &_AGENTS_LINE&. Confirm and the push button "Binding" should now say: "Binding (Exists)". Press the Okay-Check-Button to return to the workflow builder, as the step is fully defined now. You now see two new triangles in the graphic.

- Position the cursor on the arrow which is in between these two black triangles and create a new step here. For simplification choose "User decision", Title: "Decision for agent &1", Parameter 1 = &_AGENTS_LINE&. Agents: Expression = &_AGENTS_LINE&. Decision Text = "Document checked", Outcome "checked". Click on "Control" tab. Click on the button left from "Agent Assignment" and configure this task as "General Task". Go back to the step's screen, then confirm with the green-check-button to add this step to the workflow. In the result you see now: 3 container operations, one triangle, one user decision, one triangle.

- Activate the workflow pattern.

- Test workflow pattern again (F8-Button). Choose one more (last) time the "Refresh organizational environment" button. Then execute the workflow (F8-button). A new screen appears now with a user decision "Document checked" and "Cancel and keep work item in inbox". Press "Checked". Now you're back in the screen "Test workflow", again having the active workflow-log button. Press this button. You now see 3 steps, each having the name "Decision for agent US......". The first one (with your user ID) is Completed and the result is "checked". The other two are "Ready" and when you press on the "Assigned agents" here, you'll see that work item in their in box.

[code}

This was the guided procedure to create the most simplest par-for-each block in a workflow pattern. After acomplishing this, you can move forward to the more advanced stuff.

With the very best wishes,

Florin

Edited by: Florin Wach on Jul 1, 2009 11:11 AM

The following block irritates the editor so much, that when you enter this block, all formattings are gone:

- Position the cursor at the outcome of the last container operation and create a new step. Choose "Block". Step-name: "Par for each Agent". Block type "Par for each". Choose tab "Parallel Processing". Multiline Element = AGENTS. Press enter. A new nice icon should appear now at the tab strip's header, indicating that it is active. Go back to "Control tab" and create a binding from "Workflow" to "Step 'Par for each Agent'" &AGENTS[&_WF_PARFOREACH_INDEX&]& -> &_AGENTS_LINE&. Confirm and the push button "Binding" should now say: "Binding (Exists)". Press the Okay-Check-Button to return to the workflow builder, as the step is fully defined now. You now see two new triangles in the graphic.

Maybe it's the length of the article or whatsoever. I apologize for the unreadability of this post, but there seem to be some serious technical problem in the background involved. However: The content counts

Answers (2)

Answers (2)

Former Member
0 Likes

Hi,

If you are getting the Message like 'No Agents Selected'

Reasons are Below

1. Agent assignment should be active

this we can do by making the general task in PFTC

2. Agent id Should be valid

Fisrt check the agent type whether the agents are users or not

so som e times agent id should be prefixed by 'A'

so please refer the table USR21 and ADR6

and specify the correct userids

Former Member
0 Likes

Dear Vijayareddy,

Thanks for your reply. As you have said i have made it as general task by clicking attributes button and then clicked red color wheel button. I got the message "index was generated". For the multi line container element i have given initial value as user ids. They are users only as i am able to log in into R/3 using those user ids and password. In task step how should i specify the agent for the task. I have given as expression and value as multi line element name. Will the task read each row from container element each time and send work item to them?

Regards,

Bharath

vijy_mukunthan
Active Contributor
0 Likes

Hi

Clear the buffer once SWU_OBUF.

Regards

vijay

Former Member
0 Likes

I hope the User Id is concatenated with US in front in the multiline container. Please do so and then test.

Thanks

Arghadip

Former Member
0 Likes

Dear Kar,

I hope the User Id is concatenated with US in front in the multiline container. Please do so and then test.

Thanks for your reply. You are asking me to remove the US from user name or should i sent work item to user with US.

Regards,

Bharath

Former Member
0 Likes

Hi Bharath,

Go to the workflow log and see what values are populated in that container?

Arghadip meant to say that the workitem will be sent only to those users who has the prefix US in front of their user name.

For example if the agent is SAPUSER, the container should be populated with the value USSAPUSER.

Check if you have done this properly.

Regards,

Raj

Former Member
0 Likes

Dear Raj,

Thanks a lot for your reply. As you have said i prefixed US to user ids that i have given as initial value to multi line container element. Also in SWI1 i checked the container element value which has the user id values with prefix as US. But i do not know why the work item is not going to first user id specified in container element. Also when i click agents button which is present in SWI1 to find who all can process this task a pop up comes with 3 options - 1. agents 2. possible agents 3. excluded agents. when i click agents from it, message comes as "No selected agents". Kindly help me.

Regards,

Bharath

Former Member
0 Likes

Please check the correct Task whether it is General or not. I think you need to check the workflow Log and then checl Extras->Technical data to check what is the actual task that is getting executed in the agent activity step. This task can be different as there is something maintained in the Details tab of the activity step.

Thanks

Arghadip

surjith_kumar
Active Contributor
0 Likes

Hi,

Make that Task as General Task.

Goto T.code PFTC in Menu Additional Data > Agent assignment > Maintain.

There click the Radio Button General Task.

Then test the workflow.

Regards,

Surjith

Former Member
0 Likes

Dear Kar,

Thanks for your reply. As you said i checked in details tab of activity step. There in a label named "Interfaces Compatible With" the value is that of the task name that i have used. I have made task as general task. Also in technical details option in SWI1, in tree view i find that task id name is same as that of task name in workflow. Task in technical details and that in details tab of activity step are same. When i clicked Extras --> All errors i get a screen with 2 errors.

1. agent determination for step '0000000008' failed.

2. result of agent resolution does not agree with agents of task.

In task step i have given multi line container element agents as agent under "expression". Is this right? Just by giving the container element will the workflow read initial values of it (user ids) one by one (as i have given 3 user ids) and sent work item to them? How to specify the agent in task?

Regards,

Bharath

Former Member
0 Likes

I hope the agent multiline container element is having USER Id's concatenated with US in front. Test by refreshing buffer using SWU_OBUF Tcode and then Test.

Even after this if it does not work. Change task attribute to General Forwarding Not allowed and then assign the users and use those users. This will work. After this again change Task attribute to General and then Test and this will surely work.

Thanks

Arghadip