Posts filed under 'Workflow'

Synchronous Wait Steps

This one caught me out just recently while I was building a business process to poll a service every couple of seconds. Seemed simple enough: add a Wait Step to my flow, set MeasureUnit to Seconds and duration to 1, then call my service and loop back to the Wait under certain conditions. In my example I want the flow to fail if the service doesn’t complete after half a dozen attempts, so I set the Maximum Iterations property on the service step to 6 and handled the error that occurs on the 7th attempt. The workflow should run synchronously in the Application Object Manager, with the UI waiting for a response.

According to all documentation this should have worked, but instead the workflow was immediately returning a response to the UI the first time it hit the Wait Step. The workflow was continuing on exactly as expected in the background, but it appeared that Siebel was automatically persisting the workflow, making the flow asynchronous.

Took a bit of digging around, but the solution was to change the Mode of the business process. In Interactive Flow or Service Flow mode the Wait step causes the flow to move out of the UI context, but in good old 7.0 Flow compatibility mode it works as expected, blocking the UI until the workflow completes.

Doesn’t fit in very well with Siebel’s mandate of not creating new 7.0 Flows, but what can you do when there are bugs..?

Add comment August 17, 2007

Order of Events

A quick list, for reference:

  • Runtime Applet.PreInvokeMethod
  • Browser Applet_PreInvokeMethod
  • Server WebApplet_PreInvokeMethod
  • Runtime BusComp.PreInvokeMethod
  • Server BusComp_PreInvokeMethod
  • Runtime BusComp.InvokeMethod
  • Server BusComp_InvokeMethod
  • Runtime Applet.InvokeMethod
  • Server WebApplet_InvokeMethod
  • Browser Applet_InvokeMethod

Essentially, the Runtime Event occurs before the equivalent server script event for the same object, plus the Applet browser script events ‘wrap’ all server side events.All of which makes perfect logical sense, but it’s sometimes handy to see it written down in a list.

Add comment July 19, 2007

Editing XML in Workflow

Talking about the Echo method the other day I mentioned that you can use dot notation to get at property set elements, but this is such a useful tactic that I think it’s worth revisiting.

Dot notation is what Siebel call your fairly standard ‘parent.child.grandchild’ notation. Imagine a workflow with a hierarchical process property called Employee, which has assigned to it a property set with the properties Login and Password. What dot notation allows you to do is access that Login property directly, by reference to Employee.Login. Simple enough.

This notation works both ways – so you can both retrieve and set properties. To set a property using the Workflow Utilities.Echo method, you need to have the top-level hierarchical process property assigned in the first input variable and then child properties in following variables. As an example: we want to set up the simple Employee Property Set above. We already have the LoginString in a process properties and want the Password ‘geenoos’. Create a Workflow Utilities.Echo step and assign the input variables:

Input Argument Type Value Property Name
Employee Process Property   Employee
Employee.Login Process Property   LoginString
Employee.Password Literal geenoos  

Next – as I’m sure you’ve worked out – if your Employee property set has a child property set, lets say a child PS with a type of Address and properties Street and Postcode, then the Employee’s Street can be accessed with Employee.Address.Street. You can also get at the Property Set’s Value argument, using the notation property.<Value>, which also works at all levels of the hierarchy.

This is all great, useful stuff, but the real kicker comes when you’re working with XML. XML hierarchies in Siebel are just property sets, with attributes as properties and elements as <Values>. By using dot notation in input arguments, output argument and Echo steps, you can construct and edit XML hierarchies on-the-fly, something that previously was impossible without scripting.

The one limitation of dot notation is the 75-character limit to a workflow step argument. This can kick in fairly quickly when you’re dealing with all the ListOfBusinessComponent hierarchies. The workaround is to assign a sub-hierarchy to a secondary process property, do your manipulation, then assign it back in.

Add comment May 22, 2007

Manipulating Workflow Process Properties

There’s every chance you’ve never heard of the business service Workflow Process Utilities method Echo. It’s under-documented, under-used and under-rated. I’d built a whole bunch of complex workflow processes before I came across it, now I ‘Echo’ stuff all over the place.

All the method does is reflect back the input arguments. Big deal, eh? The thing is, the input arguments can be expressions or business component fields or property set values or functions or anything you can usually reference from a workflow. So you can manipulate process properties without taking any other action, or you can get a current business component field value without doing a query, or you can get at property set child elements using dot notation – all things that I’d struggled to do previously without scripting.

Plenty of good examples on SupportWeb under a search of ‘Workflow AND Echo’. Note that in early versions of Siebel 7 the display name of the method is ‘Return Property Values’, plus there’s a fixable bug in 7.0.

3 comments May 8, 2007

Detecting when a WriteRecord is New or Updated

Nathan’s enthusiatically followed up on his first contribution to eulogise about a couple of new Runtime Events…

This one is relatively simple but it is worth pointing out. Sometimes its the little things that make you weep for joy as a developer.

In the bad old days of Siebel (i.e. before 7.7), the world was running around clubbing each other over the head, saying “ugh” a lot and wearing animal skins. Then the light shone upon the world and we were given:

WriteRecordNew and WriteRecordUpdated.

These are Runtime Events that I noticed just recently. Many many times in config, you need to do something when a record is written. You place code on the WriteRecord event (so that you can avoid having to worry about the user doing Undo, stepping off a field and recorrecting etc). But then you need to do different things depending on whether the record is new or updated.

Usually what you needed to do was set some global variable when the NewRecord event fired, test that variable in WriteRecord, then clear the variable. It usually worked, but it was not elegant. I have seen implementations where the code on the WriteRecord event runs into the thousands. But we won’t mention those.

Now, the great and glorious Siebel gods have seen fit to now provide us with Runtime Events that distinguish between New and Updated records! Hallelujah brother!

Add comment May 1, 2007

Workflow Process Business Objects

A first contribution from elsewhere! Outstanding. Nathan kindly offered this note in return for ‘getting famous’. Not sure I can help with that, but everyone has to start somewhere…

I did this trying to prototype a problem I had for an interface I was working on. When you setup a Workflow Process you must assign it a Business Object, or else a whole heap of functionality within that Workflow Process does not work i.e. you cannot select Business Components etc.

My Workflow Process was triggered by a Runtime Event, and all was fine for the UI contexts where the business component of the Workflow action matched the primary business component of the UI. However, when I was in a different business object, the Row Id passed was that of a different Business Component and so my workflow did not “flow”.

For example, upon creation of a Contact in “My Contacts”, the Row Id passed in was the Row Id of the Contact. However, when you create a Contact in Account->Contacts, then the Row Id passed in is that of the Account record.

Well, there is a simple way around this, ready for it?

Are you sure you’re ready?

Okay, here it is…

In the Runtime Event, you need to set a Profile Attribute to the current Row Id to pass into the Workflow. You can then put as many Runtime Events on as many business objects as you require, as long as it always sets that Profile Attribute for the Row Id.

Too easy. A gentle warm-up from Nathan, there’s more to come…

4 comments April 12, 2007


Top Posts

Categories

Blogroll

Archives

Feeds

Recent Comments

kishore on Searching Calculated Fields an…
Darrell Jarrett on Discussion Forums for Sie…
stuandgravy on Discussion Forums for Sie…
mary on Discussion Forums for Sie…
stuandgravy on Searching Calculated Fields an…