Workflow made simple - Part II

...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

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