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

Expression in task step

Former Member
0 Likes
3,421

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

View Entire Topic
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