cancel
Showing results for 
Search instead for 
Did you mean: 

Including Actual Agent and Rule Result Agents in Task Texts

paul_abrahamson_sap
Active Participant
0 Kudos

Hi experts,

I have a very simple workflow with one step.

This task is a 'General Task' i.e. anyone can execute it but it uses a rule to determine who the agents are for the task. The rule resolves a list of users assigned to a Work Centre. The rule resolution is working correctly and the correct users are receiving the work item.

However, I have used the 'Latest Start' and 'Latest End' deadlines to send a message to a central administrator informing them that the task has passed its deadline.

In these messages I have defined the Texts in the Task - 'Latest Start text' and 'Latest end text'.

Within these texts I wish to show who was sent the item, i.e the users resolved by the rule and who (if) has actually processed the work item, but not completed it.

My Text looks like this:

The Applications outstanding for Department
&_WI_OBJECT_ID.AUTHORIZATIONGROUP& was sent but
the list hasn't been marked processed as yet. Please chase the people
who it was sent to.

The recipient was:
&_WI_ACTUAL_AGENT&

Possible recipients:
&_RULE_RESULT.AGENTS##&

Note: I used the 'Insert, Expression' and selected the attributes from the 'Select Expression' popup.

When adding the expression for the rule result agents, I specified the option 'All lines with line break'.

However, when the deadline is reached and the message sent to the central administrator, these fields are blank. It is as if the work item does not have values for actual agent and rule result agents.

Any tips on how to embed these values into my text dynamically within the task.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I think the WI_ACTUAL AGENT container element gets populated only after that particular task has been executed completely. So in your case it is not completed and rightly this value is empty. Regarding Rule_RESULT container elemt it is better you use Function Module SAP_WAPI_WORKITEM_RECIPIENTS to determine the selected agents.

Thanks

Arghadip

Answers (2)

Answers (2)

paul_abrahamson_sap
Active Participant
0 Kudos

Thanks Martin and Arghadip.

martin_nooteboom
Active Contributor
0 Kudos

As Arghadip mentioned, WIACTUAL_AGENT will not be populated until the workitem has been processed so you cannot use this in your deadline mail. For the rule result, I am not sure why this is not populated, but you can always pass the result of the rule back to a container element which you can use in the deadline message. So no need to use the WAPI there, which in fact you couldn't use unless you have a modeled deadline which you don't have if I understood your post correctly.

The question is if you need to give the user who reserved the workitem. Maybe you need to make sure users don't reserve the workitems by either educating them or do this in a technical way (e.g. make sure the workitem can never be reserved by handling the cancel button as an outcome (not straight forward) or create a job which will replace all reserved workitems at night).

Regards,

Martin

paul_abrahamson_sap
Active Participant
0 Kudos

Because my rule returns a work centre, I'm not able to actually get a list of users who received the item into the deadline message without doing a modelled deadline.

Any advice on how to model a deadline, to do the following:

- get the users who received the work item

- send a deadline notification email to the user(s) who administer this process identified by another work centre (which is determined in a rule).

Note: because our work centres numbers are different in different systems, I can't hard-code the work centre object id as the agent/recipient, I need to look up the work centre based on the search key - I've got the rule and that works, all I need is help on sending the email to a work centre determined by the rule).

Thanks,

Paul

martin_nooteboom
Active Contributor
0 Kudos

You can use the FM Arghadip mentioned (SAP_WAPI_WORKITEM_RECIPIENTS) to get the original agents. Use this in a seperate method.

Regards,

Martin