Mohammed Atef’s Technical blog

ICM Repeated DB Execute for any task steps

Introduction

In our real world we always found new needs that cannot done easily throw out-of-the-box tools. Currently I am using IBM Case Manager for delivering Automation solution, but I realized that our solution needs a custom database, during discussing with my technical colleagues, we came up with the following solution and now I am sharing this with you.

Use case

You are working in a new IBM Case Manager solution, and you have to log some case properties details in custom SQL Database for each and every step, you can do this regularly by calling stub step after each and every step, but this solution with complex your tasks design.
I am going to share with you another solution to do same requirements with better and simple solution.

Solution

Our solution is simply built on creating an automatic task (dbexec) that run with precondition based on case property value, this task actually used to run the DB Execute system step. Other task steps will set specific case property to trigger the dbexec task.

Walkthrough

Let go throw this solution in more details.

Procedure 1: Create the solution, case and tasks

1- Open Case Manager Builder from the browser, and login with valid user name and password.

2- Create solution name loans, then create the following properties (Loan Name, tmpstepid) and create role named loan manager

3- Create case named Loan DB Exec and modify the tmpstepid property to be hidden from properties, then add both properties to the case properties.

4- Create new automatic tasks named Main Task , and another automatic tasks named dbexec but with condition and repeated as shown in the following pictures
image 

image

Procedure 2: Design tasks

1- Open the main task designer and drag Role Lane then add three steps names (step1, step2, complete) to it.

2- Assign the two case properties for each step, then draw the connectors between launch Step and other three steps as shown below

image

3- Open dbexec designer and drag Role Lane then add step to it, after that add another stub step to the system Lane and draw connectors as follows

image

Procedure 3: Prepare SQL table and procedure

1- Here we are going to create the SQL table and stored procedure that needs to execute for each and every step in the Main Task2.

2- Below SQL scripts shows how to create both of them:

   1: CREATE TABLE [dbo].[loans](
   2:     [stepid] [nchar](10) NULL,
   3:     [loanname] [nvarchar](50) NULL
   4: ) ON [PRIMARY]
   5:  
   6: create PROCEDURE [dbo].[sp_addloan]
   7:         @loanname varchar(100) output
   8:     ,@stepid varchar(100) output    
   9: AS
  10: BEGIN
  11: insert into loans values(@loanname,@stepid)    
  12:     END
  13: GO

Procedure 4: Modify the main task from Process Designer

1- In Workplace XT, click Tools > Advanced tools > Process Designer.

2- Click File > Solution > Edit > case_manager_design_object_store_name > IBM Case Manager > Solutions > Loans > Solution Definition

3- Open the Main Task and Assign the tmpstepid property after or before execution for each step as follows

image

3- task care you have to assign different value for each step to launch the DBexec task

Procedure 5: Modify the DBexec from Process Designer

1- Open the dbexec task in designer as shown in procedure 4, steps 1 & 2

2- Configure the DBexecute step

3- Select the Route between the Stub and Dummy step and modify it to be a conditional  Route the in the expression space enter the following line 1=2, as shown below:

image

4- Yes you are right this condition will never happen and the task will ends after the Db execution.

Procedure 6: Deploy and test the solution

1- From Process Designer Check in the solution

2- Open Case Manager Builder and deploy the solution

3- Open Case Manager Client and create new case from Loan Db Exec

4- Go throw step1, step2 and complete steps.

5- Open the database and you will find three records in you custom table.

Conclusion

In this post we have seen how to run repeated DB execute task for each step in other tasks. This solution may be used in other ways for different requirements for example you can use it to send email instead of executing DB. i hope that help.

Reference

before ending this post i would like to thank Mr. ahmed Elwakeel my dear colleague who worked with me to implement this solution.

Advertisements

March 1, 2013 - Posted by | Uncategorized | , , , , , , ,

9 Comments »

  1. Hello it’s me, I am also visiting this site regularly, this site is genuinely good and the visitors are genuinely sharing pleasant thoughts.

    Comment by natishae12.bravesites.com | May 22, 2013 | Reply

  2. continuously i used to read smaller posts which as well clear their motive, and that is
    also happening with this post which I am reading here.

    Comment by Aya waska newest reggae music - marijuana | July 14, 2013 | Reply

  3. Hey very nice website!! Man .. Excellent .. Wonderful ..

    I will bookmark your web site and take the feeds additionally?

    I’m satisfied to seek out a lot of helpful information right here within the post, we’d
    like work out extra strategies in this regard, thank you for sharing.

    . . . . .

    Comment by 365 bet ton | August 22, 2013 | Reply

  4. I have been browsing online greater than 3 hours lately, yet I
    by no means discovered any interesting article like yours.
    It’s pretty worth enough for me. In my view, if all website
    owners and bloggers made good content material as you did, the web can be much more helpful
    than ever before.

    Comment by web hosting reviews wordpress | November 15, 2013 | Reply

  5. My spouse and I stumbled over here from a different web address and thought I might
    check things out. I like what I see so now i’m following you.
    Look forward to looking into your web page repeatedly.

    Comment by Caleb | December 23, 2013 | Reply

  6. Hi there, just wanted to say, I enjoyed this article.
    It was practical. Keep on posting!

    Comment by keyword research | May 8, 2014 | Reply

  7. Your articles are indeed very useful. Keep up the good work.

    Comment by ahemdtarek123 | August 12, 2014 | Reply

    • thanks

      Comment by mohammedatef83 | August 12, 2014 | Reply

      • I would like to ask you how is it possible to load data into case properties using DBExecute

        Comment by ahemdtarek123 | August 13, 2014


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: