Using Batch Workflow Policies For Sending Consolidated Emails
You might have heard about Batch Mode flag or noticed while working on workflow policies.

What is that? Key difference between batch and usual policies is that BWP (Batch workflow policy) works directly on data tables instead of using usual infrastructure comprising triggers and S_ESCL_REQ table. BWP evaluates more data in database, not just the records that fired WP triggers. This is usefull when you have to run your new policy over existing data.
Other interest feature of batch mode is consolidated mails. Let me explain what is it.
Siebel has a set of tools for sending email messages. They are often used to notify users about different events in application. However if a user involved in many business processes with many notifications Siebel starts to spamming this man.
For example sales department manager wants to know how many opportunities has been lost for last week. We can solve this requirement by creating respective workflow policy with action based on Send Message program type. This means that with every lost opportunity Siebel will send an email to manager with notification. And if there were 30 opties lost the manager will receive 30 emails. More convenient way is to send a single message with list of all lost opportunities instead of spamming the manager. That message called consolidated mail.
Wokflow Monitor can’t do consolidation itself. Instead it passes requests to another server component – Action Agent which looks for the same events and the same address, combine this events and pass a single request to Email Manager – one more server component that is used to sending emails.
In theory it looks like this
- Workflow Monitor started in Batch mode check the database for all records records complying policy conditions
- For every record that complies condition workflow monitor passes a request to Workflow Action Agent (creating record in S_ESCL_ACTN_REQ table).
- Workflow Action Agent checks S_ESCL_ACTN_REQ table. If there are requests marked with consolidated flag intended for a single receiver, it combines them into a single message and pass it to Email Manager (creating record in S_APSRVR_REQ table).
- Email Manager server component checks S_APSRVR_REQ and passes request to corresponding business service
Let’s try to do that.
Suppose that we want to send weekly email to specified position with list of all lost opportunities (as it described above).
As a prerequisite you have to configure your communications management infrastructure so it can be used to sending emails. Also make sure that the following Siebel Server components are activated and available on your Siebel Server:
- Workflow Monitor Agent
- Workflow Action Agent
- Email Manager
Also you should be familiar with srvrmgr utility.
1. Create workflow policy action. Provide following parameters
Name: Action name (anything you wish)
Program: there is predefined program for sending opportunity mails. That is Send Opportunity Email.
In Send Message Arguments we can provide desirable email parameters.
Subject: email subject
Message Template: all equal events with the same recipient will be combined in a single mail. Message Template is the first part of email. You can use field values from available field substitutions.
Repeating Message: second and subsequent parts of email. Again you can use field values from available field substitutions.
In recipients list we should provide list of employees/positions/contacts/addresses/something else who will receive our notification. In our case that is probably Send to Position with Sales Department Manager value (or any other position according to your organization structure)

2. Create new workflow policy.
Provide Name, Policy Group, Workflow Object and don’t forget to set Batch mode flag.
Set following conditions:
Opportunity Stage = 09 – Closed/Lost Закрыта/Отказ
Opportunity Component > Current – 7:0:0
This means that we only interested in opties in 09 – Closed/Lost stage and that have been last modified no more than 7 days ago. This is actually not a precise criteria but you can change it according to your requirenments.
Add previously created action. Set Consolidate flag: this show Action Agent that you want to have a single consolidated message.

As we work in batch mode without using triggers we don’t need to generate them.
Now everything is ready and we can start our components.
Run srvrmgr and start task for Workflow Monitor with following parameters
start task for comp WorkMon with BatchMode=”TRUE”,GroupName=”Mail Notification Group”,ActionAgent=”TRUE”
This command is used for starting a task for Workflow Monitor server component working in batch mode (BatchMode parameter) using Action Agent (ActionAgent parameter) to process policies from Mail Notification Group (GroupName parameter).
After completing the task we can see that there are several records in S_ESCL_ACTN_REQ (of course if you have opties lost in previous week). That are requests to Action Agent.
Now let’s start our Action Agent to process all this requests.
start task for comp WorkActn with GroupName=”Mail Notification Group”
After first iteration of Action Agent we can see that S_ESCL_ACTN_REQ is empty, but there is new record in S_APSRVR_REQ which is a request to Email Manager.
Finish our work by running Mail manager with following command
start task for comp mailmgr with SleepTime=60
If everything is ok request in S_APSRVR_REQ should become SUCCEEDED.
Related posts:
- E-mail not working in Siebel
- Assignment Policy
- Siebel Enterprise Server – An Overview
- Siebel WorkFlow process : Asynchronous and synchronous mode
- Implementation Of Error Control In A Workflow
- Email via Siebel Scripting or Object Interfaces Using Outbound Communication Manager

















(No Ratings Yet)
Thank you – very useful and helpful.
Andrew,
Don’t you mind if i’ll copy it into design doc tomorrow?
Alex
I have one question here…
We have set duration for 1 week ,in case if siebel server get bounced in between days…Still do we get previous created opportunities in next email?or do we lost entries in S_ESCl_ACTN-REQ?
Leave your response!
Our Stats
hit counter
Author Spotlight
Markushin Andrey
Website: http://www.siebeloracle.com/Join us in Facebook !!!!
Donate
If you find this blog useful to you, please consider making a small donation to help contribute to further development. Thanks for your kind support!
Hosted By
SIEBEL BOOKSHELF
Advertise With Us
Place your advertisement anywhere in the website.
[Nominal Rates/Genuine readers]
For details reach us at contact@siebeloracle.com
Training Partner
Advertisement
Advertisement
Recent Comments
Most Commented
Most Viewed
Log in | Entries (RSS) | Comments (RSS) | © Copyrights Siebel Expert Panel 2007-2011
Disclaimer: All information is offered in good faith and in the hope that it may be of use, but is not guaranteed to be correct, up to date or suitable for any particular purpose. Siebel Experts accepts no liability in respect of this information or its use. Siebel Experts is an India based website which is governed by Indian law. By using this website you are agreeing to abide by Indian law. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content.Product and company names mentioned in this website may be the trademarks of their respective owners.