Task Based UI @ Siebel 7.8 | Next Tip »Home

Getting user input – A headache

OkAvarageGoodVery GoodExcellent (10 votes, average: 3.20 out of 5)
Loading ... Loading ...

From past few days I have been working on requirements that involve getting user Input and then taking an action.

In most of them I had to get user input through browser script and call business service to apply business logic and condition to get the work done. I feel this is quite an inefficient way to do things.

Let me discuss one requirement with you guys and see if we can find a better solution

Requirement:

  • We have Service Request as Parent BC and Activities as Child BC.
  • Of all the child activities related to a particular Service Request only one should have status as ‘Final Solution’. When user sets the status as ‘Final Solution’ of an Activity then we should check if there is already an ‘Activity’ with status as ‘Final Solution’.
  • If yes, then user should get an OK and Cancel Dialog box asking “Do you want to mark this Activity as Final’.
  • If user clicks on ‘Yes’ then old activity with ‘Status’ as ‘Final Solution’ should be changed to ‘Interim Solution’ and this new activity should be marked as ‘Final Solution’.
  • If user clicks ‘No’ then the current activity should be marked as ‘Interim Solution’

Phew ….. I hope I am able to make it as simple as possible.

Solution:

In applet browser script  Applet_PreInvokeMethod have the following logic

if(name == “Write Record”)
  {
Call BS to check if there are multiple records with 'Status' = 'Final Solution'
        (In BS we will have loop through records to see if there are multiple records as the current record is also committed)
       if (Multiple Record == True)
          {
confirm(“Do you want to make this as final solution”);
       if( User Choice == “OK”)
Call BS again to set other record as 'Status' = 'Interim Solution'
        else
        Call BS and set this record as 'Status' = 'Interim Solution'
        }
}

Problems:

I really don’t like to call BS from browser script as it is inefficient and hard on performance.

 I know this is not an ideal solution for this requirement. I am trying to find a more optimal solution for this requirement and If I am successful I will share it with you guys.

According to me in an ideal solution:

  • We wouldn’t be calling BS from Browser Script (definitely not 2 times)
  • Browser script will only contain code showing msgbox
  • We wouldn’t have to loop for the records in BS

If any of you guys think you already have an answer then please share it with us all or I guess we will have to wait till I am able to figure out something.

  • Share/Bookmark

Related Posts


Article by neel

Authors bio is coming up shortly. neel tagged this post with: , , Read 387 articles by neel
  • Narayan
    Hi Neel,

    I need a favour from u, I am new to eScript world and dont know how to start working on it. Please guide me and also if you have any documents to read and practice please pass on.

    I checked eScript.pdf from bookshelf, found bit hard to follow.

    Kind regards,
    Narayan
  • Gururaj
    Neel,
    Set a field called "Activity id" on Service Request as soon as a activity status is made "Final Solution". Check for the field "Activity id" before changing the satatus to "Final Solution" in further activity status change. If that fied is not null then show the message saying already one activity have that status. Else without any message set the status.
    When user clicks on Yes button change the status of that activity whose id is stored in "Activity id" field to "Interim Solution" .otherwise do cancelOperation on Browser scipt.


    In the Activity write the following script in BC Write Record Event
    if (Status== "Final Solution")
    {
    this.ParentBusComp().SetFieldValue("Flag",this.BusComp.GetFieldValue(Id));
    }



    if(name == “Write Record”)
    {
    if(this.ParentBusComp().GetFieldValue("Activity id") != null)
    Confirm(“Do you want to make this as final solution”);
    if( User Choice == “OK”)
    update the status of that Activity whose id is stored in the field "Activity id" to Interim Solution
    else
    "Cancel Operation"
    }
  • Sam
    Hi Neel,
    You might have tried this but check if not....
    Ask the question first "There can be only one Final Solution. Do you really want to make this record as "Final Solution"?" and take the answer and then set a flag on this record and call the WF to change other records with "Final Solution" (if any) to "Interim Solution". This is pro active in asking user and if the user says YES then only the logic is applied. Drawback being, asking question even when the user selects final solution first time.
  • Vijay Sreeram
    In the PreSet_FieldValue call the BC to check whether there are records in status "Final Solution",if any records then use raise error text to intimate the user
  • TJ
    Hi Neel,

    We had similar but less complex requirement.
    To skip calling the BS for the first time we used MVF and then an calculated field to know whether we need to show popup or not.

    If condition is true, pop is thrown and if user clicks yes then we used named method user property to call service instead of calling through the browser script(by doing this.InvokeMethod).

    Now if you want to send two diff data to service then you can create two named method user properties and pass hardcoded parameters to it..

    This way you dont have to call service from browser script.... :)

    I havnt done performance testing on this.. but i think executing this.invokemethod will be similar to calling service directly, i dont see any other workaround for this.


    if you want to try you can try show pop up through server script by using ActiveX dll..but it would be very difficult to make an thread safe dll for siebel...
  • bhasker
    I personally would take the view that the dialog box doesn't really seem to be an essential part of the functional process; personally I would dispense with it (either you allow users to change which solution is "Final" or you do not). This would save users' time and avoid this programming difficulty.
    I would also be thinking about whether the "Final Solution" needs to be displayed in some way on the header SR record - then I think a Primary Flag field might come in to play, changing the way this solution works.
  • Problem Solver
    you can use calc field in service request to get child activity having status 'Final Solution', then use that directly in child BC browser script.
  • Apart from browser script there are some other ways to solicit user input:

    1. Interactive Workflows (available since 7.0) - use the User Interact step to display a view with an applet. That applet contains the necessary controls for the user.

    2. Task UI (available since 8.0).

    3. Unified Messaging Framework (available in Customer Order Managment but only on specialiced BC classes - not in SRs I am afraid). This framework allows you to define the message including buttons and handling.

    hth

    @lex
blog comments powered by Disqus

Polls

Do you like the new Comment System and new look to Site?

View Results

Loading ... Loading ...