Run eScript dynamically on the fly without compiling < 8.0

In our lives as developers, we face daily situtaions where we have to meet business process automation challenges.

In the Siebel essentials course, we are trained into the Siebel mantra of exhausting all declarative alternatives before resorting to using script.

But to be a successful Siebel consultant, we have to be adept in more than just one discipline.

We cannot sell ourselves as declarative config specialists.

We can dream up solutions of using fancy calculated fields (within calculated fields) and funky links based on twisted joins, that rely on sort orders to work, but this tends to be less maintainable then writing nicely encapsulated code, that can be reused.

Writing eScript is a neccessary part of life, but the process is quite cumbersome. You have to write the code, wait for it to compile, and then wait for the client to launch and test it.

As any curious developer would do, I thought there must be a better way, there should be a way to access Siebels eScript engine externally.

The breakthrough came from T.Mueller, a colleague who had the idea to build his own eScript engine.

At first, this sounds really hardcore, what kind of geek is willing to re-implement the eScript engine which has been around since the 90s?, but anyone with a strong background in ECMA/Javascript can achieve this, (a little Java background would defintely come in handy, but not neccessary).

This guide is aimed at the advanced developer, so I will outline the main concepts of this implementation.

Here is the solution overview.

  1. Install Java Developemnt Kit/Java IDE
  2. Import ECMA scripting engine
  3. Use Java Databean to connect to Siebel
  4. Pass Siebel Java application object into ECMA engine
  5. Create a class abstraction layer to translate Java methods into eScript language

You might be wondering, wether it is worth your while to build this tool, since in Siebel 8 we have Fix and Go for the ST engine. The answer depends on how close you are to using version 8.

For those who cant see 8 on the horizon, or are geeky enough to try this, then you will be priviledged to have a new Scripting tool in your arsenal.

Also remember, that even if you are using 8 now, the next project you end up on might be pre 8 =). I know of a couple of places still using 6, but hopefully none of us end up there.

Here are the advantages of this tool:

  1. Run eScript dynamically on the server without compile
  2. Quickly prototype solutions
  3. Rapid debugging and testing of scripts
  4. Highlight script and syntax problems before they are checked-in

In the next article in the series, I will show you how to build this tool, so stay tuned.


Reactions:

5 comments:

  1. Just wonder, why can't you use a UI Business services (i mean administration - business service)for this purpose?
    If you have a piece of code, that should be available for quick modifying, that is quite good solution (and not only for siebel 8).
    Of course, UI script editor is not very handy, but Tools scripting editor isnt too. I prefer to use third party editor and then just copy-paste the code.

    ReplyDelete
  2. Hi, it will become more obvious in the continuation articles, but you've highlighted the disadvantages of the UI BS simulator.

    In summary, is it very clunky to use, even with simple code, but especially if you have complex code that you want to trace in real time, and constructing complex hierarchical propertysets through the UI is a real pain.

    The advantages of creating your own IDE is obvious, just type your code, and run it in the same window. You can even use your favourite editor, and run it from there.

    ReplyDelete
  3. Guess you right. Thank you for explanation :)

    ReplyDelete
  4. wonderful!!!!!!!!

    Could u please explain more about this how u will be passing Pass Siebel Java application object into ECMA engine.

    ReplyDelete
  5. thanks for your support.

    recently project responsibilities have kept me away from investigating articles for you guys, but this is one article i intend to revisit in the short term.

    ReplyDelete

Comments are open to all, please make it constructive.