BI Publisher Demoshelf
Just wanted to share a link to a most useful resource with you:
Just wanted to share a link to a most useful resource with you:
Recently, I had to do some prototyping for typical requirements which led me to the Siebel Workflow framework as a solution.
As indicated in a previous post, workflow processes (along with the business services they call) account for almost every piece of functionality and automation in Siebel CRM). So in general it is a good idea to have an eye on workflow when it comes to automation solutions.
However, there are some pitfalls for the novice developer that often lead to frustration and even refusal of using workflow.
In this and a following post, I will describe two workflows that should serve as examples how to solve common problems in Siebel.
These are the requirements
1. Update multiple records (this post)
Users should be able to enter a search string to retrieve a list of Accounts and the target value of the Account Status field. The system should then update the Account Status field of all records in the result set to the target value.
2. Retrieve total opportunity revenue for an Account (future post)
Sum up the revenue of the current Opportunities for an Account and write the result to an Account field.
I implemented both requirements on Siebel 8.1.0.0
Let's have a look at the solution to requirement #1.
To be honest, I was surprised at the simplicity of the workflow. It is a really nice example, how the Siebel framework works.
The workflow is configured as follows:
Business Object: Account
Process Properties created: QueryField, Querytext, RecordCount, TargetValue
The first Siebel Operation step is configured as follows:
BC: Account (No Link)
Operation: Query
Search Spec Expression: "[" + [&QueryField] + "] LIKE '" + [&QueryText] + "*'"
Output: RecordCount = NumAffRows
The second Siebel Operation step is configured as follows:
BC: Account (No Link)
Operation: Update
Field Input Argument: Account State = Process Property: TargetValue
Pitfall #1: Too complicated approach
Siebel Operations inside a workflow which operate on the same BC inherit the context of the previous step, so all you need is one query operation and then the update operation will update all records in the query result set. That's it.
Pitfall #2: Problems with the primary BC
There is strange behaviour to report when the Siebel Operations use the primary BC of the workflow's Business Object (Account, that is). I used the Account (No Link) BC instead and it worked like a charm. Please don't ask why ;-)
Pitfall #3: Externalize the query string
How in god's name can someone figure out the query string if she/he is not a complete geek?
"[" + [&QueryField] + "] LIKE '" + [&QueryText] + "*'"
is built as follows:
1. Parenthesize the value of the QueryField process property in square brackets
"[" + [&QueryField] + "]"
2. Append the LIKE operator
"[" + [&QueryField] + "] LIKE"
3. Append an asterisk to the value of the QueryText process property and parenthesize it in single quotes
"'" + [&QueryText] + "*'"
4. Bring all together
"[" + [&QueryField] + "] LIKE '" + [&QueryText] + "*'"
Not too difficult - but devilish
Note that the Siebel Operations have an output argument which is useful to get the number of affected records.
Several tests showed that the workflow updated several hundreds of records in short time.
...welcome back to Part II of our tour de workflow
Let's reiterate the requirement #2
Retrieve total opportunity revenue for an Account
Sum up the revenue of the current Opportunities for an Account and write the result to an Account field.
This is the prototype workflow. As in part I, Siebel 8.1 was the implementation platform.

The workflow itself has the following properties:
Business Object: Account
Process Properties created: CurrentRevenue, LastRecord, RecordCount, TotalRevenue
Get Oppties Step:
Business Component: Opportunity
Operation: Query
Search Spec Expression: "[Account Id]='" + [&Object Id] + "'"
Output Args: TotalRevenue = BC Oppty.Primary Revenue Amount
RecordCount = Output Argument NumAffRows
Decision Step Last Record?
yes = Process Property LastRecord = true
no = Default
Go to next Oppty Step
BC: Opportunity
Operation: NextRecord
Output Args:
CurrentRevenue = Opportunity.Primary Revenue Amount (1)
TotalRevenue = Expression: [&TotalRevenue] + [&CurrentRevenue] (2)
LastRecord = Output Arg: NoMoreRecords (3)
Note: Numbers in brackets indicate the sequence of the output arguments
Update Account Step
BC: Account
Operation: Update
Field Input Arg: Revenue = Process Property TotalRevenue
Note #1: The workflow operates on the Account Business Object with Account BC as the primary BC and Opportunity as a child BC.
Note #2: Despite Note #1 it is still necessary to execute a query to get the Opportunites associated with the Account.
Note #3: The fairly new Siebel Operation NextRecord (along with its siblings PreviousRecord and QueryBiDirectional) has been introduced in Siebel 8.0. It is the first version that allows us to loop through a record set in a workflow without being outwitted by the complexity of looping. The NextRecord operation has an output argument of NoMoreRecords (true or false) which must be used in a decision step to determine whether the loop has to end or not.
Pitfall #1: Adding up the revenue amount requires two process properties. One to get the field value from the BC and the other one to serve as the accumulator. Note the sequence in the NextRecord operation to fill them in the correct order.
Hope you enjoyed this small workflow series. If you want more, drop a comment ;-)
@lex
focus yourself
glad to have found a quick solution for a possibly common requirement.
Users are trained to use the Account name field in the opportunity list to search for opportunities. However, when they use ALT+Q to enter query mode, the first column in the list has the focus, so they have to tab to the Account column. They want to have the cursor in the Account column once they enter query mode, irrespective of the placement of the column.
Here is a simple way to implement this. It introduces the DefaultFocus Applet User Property, which, if memory serves me correctly, has been introduced in Siebel 7.8.
First we add a new Applet User Prop to the Opportunity List Applet.
We use DefaultFocus_Query = Account to define the default focus column for the Query Mode.

Note that you can use DefaultFocus_Edit for Base, Edit and EditList mode and DefaultFocus_New for the New mode.
After compiling the .srf file, we can run a test....
And voilá, click Query and you find the focus on the Account column. So you can speed up your work by simply entering the search string and hitting the ENTER key.

There also was another requirement to have the focus on the Query button. However, using DefaultFocus_Edit = NewQuery did not yield the desired result. The funny thing was that the Query button only got focus after pressing ALT+ENTER (or invoking the ExecuteQuery command). Maybe the answer to that problem is somewhere out there...
Most valued readers of my blog at blogs.oracle.com.
Due to various reasons (one of them being an Oracle employee), I decided to start my blog on blogs.oracle.com. I am still an employee (just in case you might get this down the wrong throat) of course.
However I will not continue to blog on this server
Please update your bookmarks, favorites and whatnots to
http://siebel-essentials.blogspot.com
have a nice day
@lex
http:
This page contains all entries posted to Siebel Essentials in December 2008. They are listed from oldest to newest.
November 2008 is the previous archive.
Many more can be found on the main index page or by looking through the archives.