cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple mails throws in modeled Dead Line

former_member328875
Participant
0 Kudos

Hi Experts,

I am badly stuck in a scenario I am using "Multi Line Element" in a dialog activity step and Latest End Deadline is set

It sets a clock in SAP inbox when deadline missed this is fine.

But problem start when deadline missed.

When deadline missed as I am using modeled deadline I am using  Multiline Elemnet.

It throws same No. of emails what is the No of all users to each agent of multiline agent.

For example if there are 3 agents in multiline it throws 3 mails to each agent.

I am using SO_NEW_DOCUMENT_SEND_API1 in a method of activity call after modeled deadline.

As some body suggested, should I enhance the standard program RSWWDHEX_INSERT where background job for miss deadline is coming.

Many thaks for help.

Thanks,

Saquib

Accepted Solutions (1)

Accepted Solutions (1)

SandySingh
Active Contributor
0 Kudos

I think you are getting confused with the use of "Multi Line " element in workflows. We use them for parallel processing . it makes sense to "Multi Line " element when the email text for each agent is different. If the email text is same then just create  a background step with method that take the list of agents as inputs and sends the email to all of then in one go.

Fill the RECEIVERS with all 3 agents.

Regards

Sandy

former_member328875
Participant
0 Kudos

Hi Sandy

You are right I am using Multiline Element (in first activity and same in activity after modeled deadline) for parallel processing but if I remove it from the activity from 2nd activity it throws all three mails to a single agent and zero to rest two agents.

It's happening because of the following Multiline index binding which is not possible without it.

&AUTHORIZERS[&_WF_PARFOREACH_INDEX&]&

Please advise something.

Thanks,

Saquib

SandySingh
Active Contributor
0 Kudos

Hello

I would suggest that do not use the concept of "Multiline element" at all for your current requirement. Remove all references of mutiline index in current approval task.

You can have a simple design in following way:

  • Create a WF container element LT_AGENTS of type TSWHACTOR. pass the agents in the format US<userid>
  • Assign this element as agent with agent type as expression in decision  task
  • In modelled deadline route , create a simple WF mail step and assign the LT_AGENTS as recipients. If you wanne send an HTML email then you can use the FM  SO_NEW_DOCUMENT_SEND_API1  in a background step using the container element LT_agents


Regards

Sandy

pokrakam
Active Contributor
0 Kudos

You could just put it into a subworkflow and call that with parallel processing. Then each deadline works independent with only a single recipient.

former_member328875
Participant
0 Kudos

Hi Sandy,

Your idea is not working I tried it.

Mike please share a sample code n steps how to trigger outlook mail with SAP after latest end deadline. Meanwhile I am trying it by creating a sub workflow for outlook mail.

Thanks

Saquib

pokrakam
Active Contributor
0 Kudos

I didn't mean subwf for the mail, but for the whole parallel process.

So if you currently have a task executing in parallel instances, put that task together with the deadline as you have it now into its own subworkflow. It's usually a good idea to put parallel processes into subworkflows if they do anything more than a single piece of work.

former_member328875
Participant
0 Kudos

Hi Mark,

My requirement is just to send outlook mails at miss deadline.

Please share something with code and steps.

If you want any screen shot etc please  let me know.

Thanks,

Saquib

pokrakam
Active Contributor
0 Kudos

Slightly confused, and not sure if I understood this correctly: do you have three separate approvals or one approval for all  agents?

If you have three approvals then parallel subworkflows are good.

If you have one approval then you don't need parallel processing at all, just follow Sandy's advice.

former_member328875
Participant
0 Kudos

Hi Mike,

There are many approvers not fixed in No. so I am using Multiline Element in a single activity step and it's working fine deadline workitem goes to the SAP inbox.

Similar Multiline and same binding at modelled deadline (for sending the outlook mail notification at deadline reach to the same agents as previous activity) throw multiple mails.

Thank,

Saquib

pokrakam
Active Contributor
0 Kudos

Still not clear. Are you sending one work item to many agents (standard processing) or many work items, one to each agent (parallel processing)?

former_member328875
Participant
0 Kudos

Hi Mike,

Please look into the below image

Might be helpful second activity in top triggers multiple mails to the same user when miss deadline.

I can provide some more detail.

Please help me out.

Thanks,

Saquib

pokrakam
Active Contributor
0 Kudos

Hello Saquib,

Thanks for the detailed explanation, all clear. This means you are sending multiple approvals and everyone has to approve before the workflow can move forwards.

This is exactly the setup I suggested to wrap into a subworkflow to keep the parallel instances separated. The mail step you have is getting it's input from the workflow container (Authorizers) in each case. So 3 deadlines for 3 agents send mails to everyone 3 times (9 in total).

Put the whole approval/reminder process with all the additional data you need into a subworkflow with a single element Authorizer. Then call it in parallel processing and bind each authorizer to it's own workflow, just as you are now doing for the task. You will need a step up front to evaluate the rule and get the list of agents. Then each workflow can only send one mail to it's own agent.

Regards,

Mike

SandySingh
Active Contributor
0 Kudos

Hello Saquib,

I suggest you should use "Block' option in your workflow for parallel processing and wrap the Approval plus deadline escalation. Block will be like a table loop.

I think the issue that you are facing now is that you have done the parallel processing Separately  for approval and deadline mail sending steps; more like a Loop within loop. You can have the parallel processing at higher level in subworkflow (as suggested by Mike) or Block.

So as I told you earlier, clear all "mutiline" reference in approval and escalation step. Make your workflow working for one approver. Once that is working just Introduce the BLOCK to wrap up approval and deadline escalation mail sending step to make it working for "any" no of approvers. Refer blogs below

Regards

Sandy

former_member328875
Participant
0 Kudos

Hi Mike and Sandy,

I have placed the main activity in a sub workflow like this but Sub Workflow is not triggering any deadline or anything else whats wrong I m doing . Please look into screen shot n help .

It's ending with some error. Is my approach is in right direction?


Thanks!

pokrakam
Active Contributor
0 Kudos

Firstly, the task and all related deadline processing should be within the subworkflow (or block).

Secondly, you should call the subWF with only a single authoriser, using parallel processing as you had with the activity step before.

SandySingh
Active Contributor
0 Kudos

Hello Saquib,

Refer to my last post again. I have listed a blog that explains quite nicely how to implement the Block.

Regards

Sandy

former_member328875
Participant
0 Kudos

Dear Mike & Sandy,

Thanks for the great help my issue has been resolved.

I have placed all relevant activities within a Sub workflow and passed parallel processing with Multi Element binding only in Sub Workflow not in activities and it working fine.

Cheers! I am soooooooo happy

Answers (1)

Answers (1)

former_member185167
Active Contributor
0 Kudos

Hello,

That depends how you have defined the recipient for that SO* fm. I assume your multiline elements are the agents. Make sure you only use the agent for that iteration and not all of them.

The above may sound obvious but without seeing what you've done, that's all I can offer.

regards

Rick