RoutingAdapter Webservice
Siebel Architecture
The following picture shows an overview about the Siebel architecture.

In relation of the picture above concerning the configuration / customization of the b+s Routing Adapter web service with the target to route email tasks in Siebel, so the components "Siebel Tools" and "Siebel Workflow" are the keywords.
Installation and Configuration Guidelines
Routing Process Overview
The following sequence diagram gives an overview of how the routing process works.

An email is retrieved from the Mailbox by a Siebel Response Group which triggers the "BS eMail Response - Process Message_v2"-workflow with MCA Routing enabled.
The "BS NewTask_v2"-workflow uses "BS_NewTask_Map" data map for mapping the data from Activity to NewTask outbound web service call.
Required Installation Binaries
The required binaries to set up Siebel so that it can leverage the Routing Adapter's routing capabilities can be found in the archive file
BucherSuter_SiebelServer-RoutingAdapter-WebserviceInstallationFiles.zip
It is recommended to extract the content of the archive file into the following folder:
C:\<siebel_tools_root>\temp\
Step-by-Step Tutorial for Siebel Tools
This chapter describes the step-by-step tutorial with the single installation and configuration steps to add the customized b+s Routing Adapter web service for routing Siebel emails especially for the Siebel Tools settings.
It is highly recommend to perform the following changes within this section on a local Siebel database and to check in the changes finally to the server database.
The following instructions are all described working with the local Siebel database.
Prerequisites
Open Siebel Tools (1), enter login credentials for a connection to the local Siebel database (2) and login by press the button "OK".

Configure the "Object Explorer" view permissions, to see all needed components and their fields during the configuration of this web service.
a. Open "Development Tools Options" dialog window over menu "View > Options..." (1) and change to tab "Object Explorer" (2).
b. Select in addition the following objects (if not yet enabled).
Object Value Business Service (with all his subtree objects) ENABLED Integration Objects (with all his subtree objects) ENABLED Workflow Processes (with all his subtree objects) ENABLED Open tab "Detail" of the "Object Explorer" view.
Step 1: Create a new project
Create a new Project: "MCA Routing Adapter Service".
Select the record "Project" in the "Object Explorer" view (1) and add a new project by adding a new record (context menu on project list) (2).

Alternatively, the new record can also be added using the menu "Edit > New Record".
Enter "MCA Routing Adapter Service" as the new project name.
Then lock the project by enabling parameter "Locked".
Step 2: Set filter for project specific overview
Open project list field on object explorer view (1) and select project "MCA Routing Adapter Service" (2) or alternatively project "** My Locked Projects **".

Step 3: Import Routing Adapter Service WSDL
Navigate to menu "File - New Object..." (1) to open "New Object Wizards" dialog window.
Then change to tab "EAI" (2) and select object "Web Service" by executing a double click on it (3).

On the wizard select the locked project "MCA Routing Adapter Service" (1) and specify the WSDL for Outbound Web Service (Outbound-NewTask-Webservice-WSDL\bucher-suter.ch.SiebelRoutingAdapter.wsdl) which is available in the archive file described in chapter Required Installation Binaries (2).
Then, press "Next >" to proceed the wizard (3).
infoThe .xml and .log files which would be created during the import process are per default in the same folder where the .wsdl file is located.
infoCopy the .wsdl and the .xsd files for Outbound Web Service into SIEBEL_TOOLS_ROOT\TEMP directory if there should be troubles with generating the .xml and .log files (Error SBL-EAI-50228 and/or SBL-EAI-04262). See Siebel Doc ID 1542583.1.
Finish the import by clicking the "Finish" button.

Verify that the following objects are available:
Step 4: Add fields to Business Component "Action"
Set project filter back to "** All Projects **" (1) and open record "Business Component" (2).
Choose existing business service "Action" (3) and check it out by selecting "Check Out Object" on context menu of the record (4).

Press "Check Out" to check out the business component (5).

Open the "Fields" subtrees record of the business component "Action" (1), select an existing record (2) and create a new record by selecting "New Record" on context menu of the selected record (3).

Alternatively, the record can also be copied using the menu "Edit > New Record".
Repeat the previous step several times to add the following new fields:
Name Join Column Text Length Type MCA_PreferredAgentID S_EVT_ACT_X ATTRIB_xx min. 30 DTYPE_TEXT MCA_PreviousTaskID S_EVT_ACT_X ATTRIB_xx min. 30 DTYPE_TEXT MCA_RerouteReason S_EVT_ACT_X ATTRIB_xx min. 30 DTYPE_TEXT MCA_RerouteScript S_EVT_ACT_X ATTRIB_xx min. 30 DTYPE_TEXT MCA_RouteTimeStamp S_EVT_ACT_X ATTRIB_xx - DTYPE_DATETIME MCA_RoutingStatus S_EVT_ACT_X ATTRIB_xx min. 30 DTYPE_TEXT infoPlease select the ATTRIB_xx fields which are not already in use.
Navigate to menu "Tools > Check In..." (1), select edited business component "Action" (2) and press "Check In" to upload to the server database (3).

Set project filter back to "MCA Routing Adapter Service".
Step 5: Add Integration Object "UpdateTask"
Navigate to menu "File - New Object..." (1) to open "New Object Wizards" dialog window.
Then change to tab "EAI" (2) and select object "Integration Object" by executing a double click on it (3).

On the wizard select the locked project "MCA Routing Adapter Service" (1) and the business service "EAI Siebel Wizard" (2).
Then, press "Next >" to proceed the wizard (3).

As source object and source root select "Action" (1).
Then, define as new Integration Object the name "UpdateTask" (2) and press "Next >" to proceed the wizard (3).

Deselect all the "Action" integration component subtree components, that only the main component keeps selected (1).
Then, press "Next >" to proceed the wizard (2).

Finish the wizard and add the integration object by pressing "Finish" (1).

Open the "Integration Component Field" subtrees record of the "UpdateTask" integration object (1).

If integration component fields are not visible please take a look into chapter Prerequisites.
Inactivate all the integration component fields except the following and change the XML-Tag parameter of record with name "Id" into MediaURL.
Name XML-Tag Inactive Id MediaURL FALSE MCA_PreferredAgentID MCA_PreferredAgentID FALSE MCA_PreviousTaskID MCA_PreviousTaskID FALSE MCA_RerouteReason MCA_RerouteReason FALSE MCA_RerouteScript MCA_RerouteScript FALSE MCA_RouteTimeStamp MCA_RouteTimeStamp FALSE MCA_RoutingStatus MCA_RoutingStatus FALSE To change several records at the same time, select desired records and navigate to menu "Edit / Change records". Set value Inactive = Y or N.
To select all records, select the first 2 records with Ctrl+Click, then scroll down to the last and select it with Shift+Click, scroll up to first and select it again with Ctrl+Click.
Open the "Integration Component Key Field" subtrees record of the "UpdateTask" integration object (1) and change the existing parameter "Activity UID" as follows into "Id" (2):
Name Field Name Id Id 
Step 6: Add Integration Object "BS Action_IO"
Navigate again to menu "File - New Object..." (1) to open "New Object Wizards" dialog window.
Then change to tab "EAI" (2) and select object "Integration Object" by executing a double click on it (3).

On the wizard select the locked project "MCA Routing Adapter Service" (1) and the business service "EAI Siebel Wizard" (2).
Then, press "Next >" to proceed the wizard (3)

As source object and source root select "Action" (1).
Then, define as new Integration Object the name "BS Action_IO" (2) and press "Next >" to proceed the wizard (3).

Deselect all the "Action" integration component subtree components, that only the main component keeps selected and the subcomponent "Action_Contact" (1).
Then, press "Next >" to proceed the wizard (2).

Finish the wizard and add the integration object by pressing "Finish" (1).

Open the "Integration Component Field" subtrees record of the "BS Action_IO" integration object (1).

If integration component fields are not visible please take a look into chapter Prerequisites.
Change the XML-Tag parameter for record with name "Id" of integration component "Action" into MediaURL.
Name XML-Tag Inactive Id MediaURL FALSE
Step 7: Suppress Task Status Updates
Updates of Email tasks with the Connects for Siebel happen on two fronts: One is performed by the Connects for Siebel Routing Adapter by using the UpdateTaskByID-request with value "02", the other by the agent himself when pressing "Accept Email" and the triggering of the event response handler "OnMailAnswered", "SingleField.'Primary Owned By'. Caused by race conditions these updates can happen at the same time which in turn causes inconsistency issues in Siebel.
Instead of updating the 'routed' state of an email task by using the UpdateTaskById-request of Connects for Siebel Routing Adapter, it is recommended to only set the value "02" (routed) via the "OnMailAnswered" event response handler as the following figure shows:

To only use the event response handler "OnMailAnswered" to update the email task status, the following parameter must be set in the Connects for Siebel Routing Adapter's configuration-file, section [Gate_siebel]:
...
SuppressTaskStatusUpdates = 2
...
Furthermore, the MCA_RoutingStatus field on "Action" business component must be changed; otherwise the response handler will fail. In Siebel Tools in the window "Object Explorer" open the Field "MCA_RoutingStatus" of Business Component "Action". Change the properties (View > Windows > Properties Window) "No Copy" and "Force Active" to TRUE.

Step 8: Import MCA Workflow Processes
Set project filter back to "** All Projects **" (1) and open record "Workflow Process" (2).
Choose existing record (3) and import a workflow by selecting "Import Workflow Process" on context menu of the record (4).

Select workflow (Workflows\BS xxx.xml) which is available in the archive file described in chapter Required Installation Binaries (5) and press "Open" (6). Then, choose current locked project (7) and press "OK" to add workflow to the project (8).

Repeat the previous step several times to add all the following workflows
BS NewTask_v2.xml
BS QueryTaskById_v2.xml
BS QueryTaskByStatus_v2.xml
BS UpdateTaskById_v2.xml
BS eMail Response - Route Email_v2.xml
BS eMail Response - Process Message_v2.xml (should be published as the last workflow)
Set project filter back to "MCA Routing Adapter Service".
Verify that the following workflows are available:
Open the "WF Step" subtrees record of the "BS eMail Response - Process Message_v2" workflow (1) and select the step "Route Message" (2).
Verify that the "Subprocess Name" parameter is set to "BS eMail Response - Route Email_v2" otherwise include it.
Name Subprocess Name Route Message BS eMail Response - Route Email_v2 
Open the "WF Step I/O Argument" subtrees record of the "BS NewTask_v2" workflow steps "Write To File" and "Write to File" (2), select record "FileName" (2) and configure the XML-File output paths (parameter "Value/Search Specification field") as follows (3):
Workflow Step Step I/O Argument Value/Search Specification Write to File FileName C:\Siebel\15.0.0.0.0\eai_temp\NewTask_input.xml Write To File FileName C:\Siebel\15.0.0.0.0\eai_temp\NewTask_output.xml "C:\Siebel\15.0.0.0.0\eai_temp\" reflects the default directory for Siebel CRM Innovation Pack 2015. Change the path in the Value/Search Specification so that it fits your Siebel CRM version!

Please be aware, that the EAI file transport should have write access on this path. Refer to the troubleshooting section for more information if there should appear some problems.
Navigate to menu "View -> Toolbars -> WF/Task Editor Toolbar" to enable toolbar "WF/Task Editor Toolbar" (if not yet enabled).

Open record "Workflow Process" (1), select new added "BS xxx" workflow (2) and publish / activate them by pressing the "Publish/Activate" button on the toolbar "WF/Task Editor Toolbar" (3).
Then repeat sub-step 2 and 3 again for the other five workflows.

To verify that the imported workflows are successfully published / activated the status column should have changed from "In Progress" to "Completed".
Because of a dependency ("BS eMail Response - Process Message_v2.xml" should be published as the last workflow), the following errors could appear by publishing the "BS eMail Response - Route Email_v2.xml" workflow. This error can be ignored.
Step 9: Compile Project
The project "MCA Routing Adapter Service" should now have the following tree elements.

Navigate to menu "Tools > Check In..." (1), select new project "MCA Routing Adapter Service" (2) and press "Check In" to upload new project to the server database (3).

Open record "Project" (1) and unlock the project "MCA Routing Adapter Service" (2) by disabling parameter "Locked" (if not yet disabled after check in).

Navigate again to menu "Tools > Check In..." (1), select new project objects (2) and press "Check In" to upload to the server database (3).

Get the new Siebel resource file (.srf) by compiling all projects:
Do not compile or modify the default repository that Siebel Tools uses. This file is locked because the Siebel Tools client is currently reading it. If you attempt to compile this repository, then Siebel Tools displays an error message.
To identify the repository you must compile:
a. Use a text editor to open the application configuration file "tools.cfg" which is located in the directory "SIEBEL_TOOLS_ROOT\bin\language_code
b. In the Siebel section, examine the parameter "RepositoryFile" to determine the repository that it references (siebel_sia.srf or siebel.srf).
Navigate to menu "Tools > Compile Projects..." (1), select option "All projects" (2), choose repository path & filename (3) and press "Compile" to generate new resource file (4).

Step 10: Deploy Project
Stop the "Siebel Server" service on the Siebel application server(s).

Overwrite the current .srf file located on the Siebel application server(s) with the just new compiled .srf file.
In general the .srf files on the Siebel application server(s) are located under the following path:
C:\<siebel_installation_folder>\siebelsrv\OBJECTS\<language>\Make a copy of the current .srf file before the replacement.

Start the "Siebel Server" service on the Siebel application server(s) again.

Step-by-Step Tutorial for Siebel Web Configuration
This chapter contains a step-by-step description to add the customized b+s Routing Adapter web service for routing Siebel emails especially for the Siebel Web settings.
The figures in this section were created by using Siebel CRM Open UI mode. There should be no difference when the Siebel CRM HI mode is used instead.
Step 1: Activation of Enterprise Application Integration (EAI)
Log in Siebel Call Center as an Administrator.

Open "Site-Map" overview.

Navigate to link "Enterprises" of bookmark "Administration - Server Configuration".

Enable the component group "Enterprise Application Integration" (if not so far).

Step 2: Activate Workflow Processes
Open "Site-Map" overview.

Navigate to link "Workflow Deployment" of bookmark "Administration - Business Processes".

Select "Active Workflow Processes" in the dropdown menu

Set filter for new Routing Adapter Service workflows:
Select Name in the dropdown-menu, enter "BS*" into the text field, and press the arrow-button to execute the filter

Activate the new created workflow processes:
Select desired workflow process and press "Activate" to activate this workflow. The activated workflow should appear in the "Active Workflow Processes" tab list afterward.
Then repeat this sub-step to activate all other workflows.
After an update of an existing workflow process in Siebel Tools and a new compilation of the Siebel resource file (.srf) the new version of the workflow process has to be activated again. So the current workflow version becomes the state "Outdated" and the new version gets "Active".
Set new filter for existing "eMail Response" workflows:
Select Name in the dropdown-menu, enter "eMail Response*" into the text field, and press the arrow-button to execute the filter

If required do also activate the following workflows:
Name eMail Response - Analyze Message eMail Response - Append Thread Id eMail Response - Auto Response eMail Response - Client Send Email eMail Response - Create Activity eMail Response - Get Entitlement Id eMail Response - Identify Language eMail Response - Parse Junk Email eMail Response - Process Message eMail Response - Process Service Request eMail Response - Response Workflow eMail Response - Resume Workflow eMail Response - Route Email eMail Response - Save As Draft eMail Response - Search Spec eMail Response - Send Acknowledgement eMail Response - Send Auto Response eMail Response - Set Parent Activity Status eMail Response - SR Help eMail Response - SR Query eMail Response - SR Status eMail Response - SR Submit eMail Response - SR Update eMail Response - Update Activity Status eMail Response - Update Activity from BCC Message Select the desired workflow process and press "Activate" to activate this workflow. The activated workflow should appear in the "Active Workflow Processes" tab list afterward.
Repeat this sub-step to activate all other workflows.
Step 3: Import Data Map
Open "Site-Map" overview.

Navigate to link "Data Map Editor" of bookmark "Administrator - Integration".

Import the data map "BS_NewTask_Map.XML" (Datamap\ BS_NewTask_Map.XML) which is available in the archive file described in chapter Required Installation Binaries:
Press "Menu" (1) and select record "Import Data Map" (2) on menu list.
Choose file (3) and press "Import" (4) to perform the import process.
Validate the data map
Select Name in the dropdown-menu, enter "BS NewTask Map*" into the text field, and press the arrow-button to execute the filter

Select new integration object map record "BS NewTask Map" and press "Validate" (2).

Step 4: Import Inbound Web Services
Open "Site-Map" overview.

Navigate to link "Inbound Web Services" of bookmark "Administration - Web Services".
Import the web service "RoutingAdapterInterface.XML" (Inbound-Webservice-Config\ RoutingAdapterInterface.XML) which is available in the archive file described in chapter Required Installation Binaries:
Press "Menu" (1) and select record "Import EAI WebService" (2) on menu list.

Choose file (3) and press "Import" (4) to perform the import process.

If the following error message appears during the import, the Authentication Type has to be changed to "None" instead of "Username/Password - clear text" in the RoutingAdapterInterface.XML for all Service Ports:
Method 'SetFieldValue' of business component 'Operation' (integration component 'Operation') for record with search specification '[Operation Name] IS NULL' returned the following error:"The value entered in field Authentication Type of buscomp Operation does not match any value in the bounded pick list WebService Authentication Type Picklist.(SBL-DAT-00225)"(SBL-EAI-04451)
Update "Address" fields of the Service Ports applet: Select new web service record "RoutingAdapterService" and change parameter "Address" of dedicated service port as follows:

Field Value Address Replace:
{web_server} -> your Siebel web server
{lang} -> your used language [i.e. enu]Example:
http://siebelserver.company.com/eai_enu/start.swe>?SWEExtSource=WebService&SWEExtCmd=Execute
or for secure communication
https://siebelserver.company.com/ai_anon_enu/start.swe?SWEExtSource=SecureWebService&SWEExtCmd=Execute
Make sure that "Authentication Type" for WS operations (QueryTaskById, QueryTaskByStatus, UpdateTaskById) is set to "Username/Password - clear text".

Press "Clear Cache" to clear the cache.

Optional: Press "Generate WSDL" to save the web service WSDL file.

Step 5: Import Outbound Web Service
Open "Site-Map" overview.

Navigate to link "Outbound Web Services" of bookmark "Administration - Web Services".
Search for "Routing" in row "Name" and press the "arrow"-button or press the "enter"-key


If the search shows an entry, please continue at step 5. Otherwise, import the Outbound Web Service as described in step 4.
Import the web service "bucher-suter.ch.SiebelRoutingAdapter.xml" which was created during WSDL import in Siebel Tools (see chapter 3.3.4 - sub-step 2):
Press the "gear"-button (1) and select record "Import EAI WebService" (2) on menu list.

Choose file (3) and press "Import" (4) to perform the import process.

Update "Address" field of the Service Ports applet: Select new web service record "RoutingAdapterService" (1) and change parameter "Address" of service port as follows (2):

Field Value Address Replace:
{media_server} -> your b+s media serverExample:
http://mediaserver.company.com:10900/RoutingAdapterServiceMake sure that "Authentication Type" for WS operations (NewTask, RemoveTask) is set to "Username/Password - clear text".

Press "Clear Cache" to clear the cache.

Optional: Press "Generate WSDL" to save the web service WSDL file.

Step 6: Create Communication Profile
Open "Site-Map" overview.

Navigate to link "Communications Drivers and Profiles" of bookmark "Administration - Communications".

Set filter for existing "Internet SMTP/POP3 Server" communications driver:
Press "Query" (1) to open filter configuration view, configure in parameter "Name" value "Internet SMTP*" (2) and press "Go" (3) to execute filter. Then, select communications driver record "Internet SMTP/POP3 Server" (4).


On tab "Profiles" press "plus"-button to create the new profile "MCA Routing Email Profile" and configure to following values:
Field Value Name MCA Routing Email Profile Organization Default Organization Responsibilities Replace:
<your responsibility> -> your responsibility
Example:
b+s Responsibility
The new email account needs a dedicated responsibility. Such a responsibility can be created via "Administration - Application / Responsibilities".
Add profile overrides parameter:
Press "plus"-button in section "Profile Parameter Overrides" to configure a parameter for the new email account profile.

The following parameters should be configured:
Name Value Delete Processed Message False If you set this parameter to TRUE, then messages are deleted from the incoming email directory after they are processed. If you set this parameter to FALSE, then messages are moved to the processed email directory after they are processed. Failed Email Directory C:\<desired_directory_path>\email\failed From Address Valid email-address of email account Incoming Email Directory C:\<desired_directory_path>\email\incoming Loopback Email Directory C:\<desired_directory_path>\email\loopback POP3 Account Name POP3 account name of desired email account POP3 Account Password POP3 account password of desired email account POP3 Server IP-Address of the POP3 Server (i. e. MS Exchange Server) POP3 Server Port POP3 Server Port (Default: 110) Processed Email Directory C:\<desired_directory_path>\email\processed Reply-To Address Valid email-address of email account SMTP Account Name SMTP account name of desired email account SMTP Account Password SMTP account name of desired email account SMTP Server IP-Address of the SMTP Server (i. e. MS Exchange Server) SMTP Server Port SMTP Server Port (Default: 25) Sent Email Directory C:\<desired_directory_path>\email\sent 
Please be aware, that the EAI file transport should have write access on this desired directory path. Refer to the troubleshooting section for more information if there should appear some problems.
Step 7: Configure Response Group
Open "Site-Map" overview.

Navigate to link "All Response Groups" of bookmark "Administration - Communications".

Press "New" (1) to create a new response group "MCA Routing Response Group" and configure to following values (2):
Field Value Name MCA Routing Response Group Service Name Workflow Process Manager Method Name RunProcess Server Replace:
<YOUR_SIEBEL_APP_SERVER> -> your Siebel server
Example:
appsrv1
Note: The Application Server Name is needed for this field, not the Hostname.Startup Active 
Add communication profile to response group:
Select "Profiles" (1) in the dropdown and press the "arrow"-button to add a new profile.
Select profile "MCA Routing Email Profile" which was created on previous step (3) and press "OK" (4) to add it.

Add input argument parameters: Select "Input Arguments" (1) in the dropdown and press the "plus"-button (2), and configure an input argument parameter for the new response group (3).

The following parameters should be configured:
Name Value Enable MCA Routing TRUE Enable Smart Response FALSE ProcessName BS eMail Response - Process Message_v2 RowId Smart Response FALSE 
Change back to the tab "Response Group" (1), press "Menu" and select "Submit Response Group Changes" (3) to submit the changes.

Step 8: Restart Siebel Server Service(s)
Restart "Siebel Server service" on all involved Siebel application server(s).

Due to this service restart takes a lot of time it's recommended to first stop and then start the service again.
Troubleshooting
The MCA Workflows Cannot Access the Temporarily Created Email Files
Indicator
The Email Routing does not work and in the Siebel Server log files of the process Communications Inbound Receiver ("CommInboundRcvr_xxxx_yyyyyyyy.log") there are error messages available, which indicate that the temporary XML-Files "NewTask_input/output.xml" could not create or that it is not possible to access to the temporary mail task.
Possible cause(s)
There is probably a write access restriction for the EAI file transport available.
By default, the Siebel temporary folder, SIEBEL_SRVR_ROOT\TEMP, is a permitted folder and is not required to be explicitly configured with the EAIFileTransportFolders parameter. If the parameter is not configured, then writing is allowed only to the Siebel temporary folder; any attempt to write a file to a folder other than the Siebel temporary folder will fail.
The EAIFileTransportFolders parameter can be set at the enterprise or server level as a semicolon-separated list.
This works as follows:
Start Siebel Server Service if not yet running
Open a command window in admin mode
Navigate to the Siebel Server Manager path
C:\<Oracle HOME-Directory>/siebsrvr/BINOpen Server Manager Console
srvrmgr /g localhost /e <enterprisename> /u <username> /p <password>Use the following command to configure the EAIFileTransportFolders parameter at the enterprise level
change ent param EAIFileTransportFolders=\\fileserver\fs1;\\fileserver2\fs2Use the following command to configure the EAIFileTransportFolders parameter at the Server level
change param EAIFileTransportFolders=\\fileserver\fs1;\\fileserver2\fs2 for server <servername>
Note: If the following error occurs...
SBL-ADM-60070: Error reported on server 'Gateway Server' follows:
SBL-SCM-00028: Key not found
...check the "<servername>" from the command above. It must be the
application name and not the hostname.
Additionally, the application configuration file has to adopt as follows:
Open the application configuration file (uagent.cfg) in a text editor.
Add the following section
[EAIFileTransportConfigSubsys]
EAIFileTransportFolders = \\fileserver\fs2;\\fileserver2\fs2
Finally, restart the Siebel Server Service.