Making Siebel Interviews easy

Updating Multiple Records via Workflow

I am back with an interesting interview question that I have been asking in past few interviews that I have taken and surprisingly nobody has been able to answer it correctly.

It is quite a simple question and answer is even simpler but people are just not aware of it.

Question:

Create a workflow that will query Opportunity with status as “Won” and then update the status of these opportunity records to “Closed”.

*Need to accomplish this inside the workflow without using any kind of script.

Usual Answer:

Usually candidates are able to answer till the query part which is using the Siebel Operation “Query” Step but they are stumped at the part of updating “Multiple Records” inside workflow as there is no looping mechanism available inside workflow (till Siebel 7.x). So, usually they say that we need to invoke a business service which will loop through records and update.

Actual Answer:

Actual answer is that you just need to use “Siebel Operation” step again with “Update” operation and Siebel will update all the records that are returned by “Query” step.

This behavior is possible due to Business Component that we give in “Siebel Operation” step and Siebel is able to maintain the BC context created by Query method and update method uses this context to udate all the records returned by Query method

I found a really good post explaining this with help of an example workflow.

  • Sunaki

    One more way to accomplish this would be to invoke the Workflow Process Batch Manager.

    Thanks,
    Sunaki

  • jeetu

    very good solution…

    thanks

  • Siebel

    very much interesting…. thanks.

    • venkat

      why cant we try using Workflow policy instead. whenever opportunity status is set to won . policy fires and status is set to closed.

  • Rick

    I believe this is only possible for Child BC's. What if I want to update all the found records in the primary BC?

  • Saranya

    Hi Neel,
    As mentioned in the example,the NextRecord operation is available only in siebel 8.1 version..But i want the solution
    for your scenario in Siebel 7.7.How to update multiple child
    records with a Workflow in Siebel 7.7 version? Pls let me know.
    No need of detail explanation also..Just tell me the workflow
    steps needed…

    Thank You..

  • Anbuselvan

    Hi All,
    Using these solution, multiple records are getting updated in local. But while trying in thin client(Our Development environment), it is not getting updated. Only the last record is gettinig updated.

  • Anbuselvan

    In addition to my comments, i have noticed the following changes.
    Local : Property “Siebel Operation Object Id” is “*” while doing simulation.
    Dev/Thin client : Property “Siebel Operation Object Id” contains some “row_id”, for this record only value is getting updated.

  • Anbuselvan

    Dear All,

    Instead of having two steps to update multiple records, we can use single update step. Single siebel operation update step updates multiple records.

  • SreeHarsha GV

    Hi Anbuselvan,
    I believe we require two steps to update. One for Querying all the set of records with given condition and other for updating these set of records.
    The default input to a workflow will be the Object id of primary BC and hence all the records of its child bc and hence if you require any updates on all of these records, no need of QUERY step. But incase you require to update any records of certain conditions you need to go for this step.
    Please correct me if i am wrong. :)


  • Kv

    Hi All,

    This Workflow scenerio is explained in Workflow Bookshelf.

    Have a look..!!!

  • Deepthikanupu

    Hi All,
    Instead of taking 2 siebel operation, we can take 1 desicion step for checking the status as “Won” & 1 siebel operation step for updating that opportunity records Status as “Closed”. Next we can use runtime method to invoke WF .

  • thni

    The above solution dosen't seems to work as mentioned. http://download.oracle.com/doc
    Bookshelf has a similar scenario explained. 

    Please correct me if I am wrong or if I missed something.

  • Hari

    Good one.Can you please let me know this with different scenario:Update only certain records.I mean not all the records with Opprtunity “Won”.Only some records have Opportunity “won”.

  • sandeep

    sir, when i try to view the post (underlined below), that explains your answer, it is saying that the required page is not existing…