Workflow made simple - Part I

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.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

The intention of this blog is to share findings about Siebel CRM and Oracle Business Intelligence Enterprise Edition (Oracle BI EE formerly known as Siebel Analytics) from technical and other (sometimes unprecedented) perspectives.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today