cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning agents using rules directly in task - is it possible?

leif_almgren
Participant
0 Kudos

I have spent a lot of time going through the FAQ's and tutorials, but they all seem to assume that you are designing a full workflow. All I want to do is to create a workflow task and assign it to different persons when an Idoc posting fails. This works fine as long as I assign the users (or organizations) static using "Agent assignment" in the Task maintenance, but if I define a rule (which works fine in simulation) and set it as the default rule and then remove the static assignment of agents, no workflow task is created.

Here are the full details of what I did:

First I copied a standard task (WMTOCO_ERROR) into a new task, enabled the standard triggering event and then went into "Additional data/Agent assignment" and assigned an organization to it. This works fine, everytime an Idoc posting fails, a workflow task is created for the person(s) assigned to the organization.

Then I copied the standard rule "edi_process" into a new rule, replaced the function module with my own and ran the simulation. The simulation works fine, and will return a different agent depending on the data in the Idoc.

Finally I replaced the "Agent (Default rule)" with my newly created rule, and re-created the binding exactly like it was for the standard rule (I use exactly the same container, so no need for a new).

Now I assume that I have to delete the static Agent assigment, because otherwise the rule will never be used, correct? But if I do this, no workflow task is created, not even for the person setup as the EDI/Idoc administrator. So what can I do to enable my custom rule?

All helpful answers will be rewarded.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Lief,

If I understand correctly then did you use the Agent Assignment > Maintain to declare the 'static' agent.

If yes, then remove the agent and declare the task as 'General'.

Hope this helps.

Former Member
0 Kudos

it is not a good idea to set task as general because it will bring potential security issue when fowarding the workitem. So, try to use unit, job, or role to cover all responosible agents determined by rule.

leif_almgren
Participant
0 Kudos

Hi Manish. Yes, you understood correctly and thanks for suggesting the change. Unfortunately it makes no difference.

Anyway, I made some progress and I can now see that my custom rule is in fact being activated. Only problem now seems to be that it behaves differently in simulation and in real use, and I could not find a good way to debug it in real use (breakpoints won't work as the code is executed by the batch user).

I will flag this question as answered, as the problem is now a different one.

Edited by: Leif Almgren on Sep 23, 2008 11:58 AM

leif_almgren
Participant
0 Kudos

Actually, after some debugging I found that Manish' suggestion was correct (I updated your points!). After solving the problem in the rule, I found that I had to set the task as "General". If set to something else, the rule would still be applied but the agents assigned would not be considered valid and therefor no task was created.

Answers (0)