While we're waiting for Frank to follow up (he's usual super busy), I
think I struck upon another limitation in the current contextual event
model, though I ask any readers who know otherwise to post to the
group with their understandings please.
I'm currently working on a programmatic approach to contextual events,
I'll blog about it next week (for the record it's mentioned in Frank
and Lynn Munsinger's book, it's nothing new). Like declarative
contextual events, the programmatic solution requires contextual
events are invoked by action events on buttons, or value change events
on fields. The payloads to be communicated to the contextual event
consumer are actually attached to the button or field themselves
programmatically. Note this solution for contextual events is very
web page specific, as it requires the actual UI components to both
invoke the events from the programmatic code and carry the payloads.
The contextual event bindings actually map to ActionListener or
ValueChangeListenerSomething (class name escapes me) proving this
fact.
Today I was thinking about what if I wanted to raise a contextual
event via the actual task flow itself? In other words can I in the
task flow diagrammer declarative raise a contextual event in the flow
rather than from a page? I think it seems reasonable in the task flow
diagrammer, given I take a certain logical route through the flow, I
might want to raise events and pass payloads to the parent
application. I also think given there's great emphasis on not hiding
code in web page listeners, but showing their calls via "Method Call"
activities in a declarative in-your-face diagram type approach as a
design principle, it would seem consistent we should also be able to
raise contextual events via task flows declaratively too.
For example say I'm a call center clerk logging different phone
inquiries. At a certain point in my BTF based on the person who calls
me, a task flow router activity calls a method to determine if the
customer is a new customer or old customer. If it's a new customer,
on taking a different BTF route, I want to communicate to the calling
application that it needs to do something specific to new customers
like show a check list of sign up questions or remind the operator to
be friendly, smile and steal as much money from the new customer as
possible. If it's an old customer, instead we tell the calling
application to display a screen of survey questions on customer
satisfaction, or remind the operator to steal as much money from the
old customer as possible.
Given the declarative task flow contextual event idea, it doesn't
appear it's possible to define contextual events declaratively at the
moment in the task flow diagrammer. As (from my understanding
described at the beginning) the contextual events can only be raised
from action and value change listener events based on UI Components.
This means even if we were to programmatically raise the contextual
event via a task flow method call, we have no UI Component to add our
payloads too.
For the record I considered the task flow Parent Action activity, but
it's really to do with invoking navigation within the parent
application, not events which pass data.
I'd appreciate any comments if my conclusions are wrong. As Frank
said, it's a brave new area that not many people are using at the
moment, so any discussions are good discussions IMHO.
Cheers,
CM.
> ...
>
> read more »