PDA

View Full Version : Understanding action-sequence



spmva
05-26-2006, 05:30 AM
Now that I'm past playing around with the samples and creating some simple reports with my own data, I've moved into more realistic efforts and with that comes some questions.

1. Could someone please give some brief definition of the different possible values for result-type. I was able to find the acceptable values (Report, Process, Rule, View and None) in the Pentaho_Creating_Solutions document, but there was nothing to tell me how each option would affect my output.

2. I'm having trouble understanding the scope of inputs/outputs.

2a. From my tests, it seems that can be globally used in each action-definition as long as they are referenced as action-inputs for that action-definition. So in







...



...

is "myInput" equivalent or does the mapping attribute need to be present as in:







...



...

or is the mapping attribute only need to be there if the names of the inputs are different?

2b. I understand that values set in the section are values that will be set by the time the entire sequence is completed. Are those values set by creating an action-output of the same name and type within an action-definition?

3. Perhaps I'm not thinking about the usage of the action-sequence properly, but is there a way to stop an action-sequence once it has started? Consider a situation where you might use a Javascript to check some input parameters for validity. If the values are invalid, the action-sequence should stop.

Best regards,

Steve

mbatchelor
05-26-2006, 07:47 AM
I'll see if I can answer most of your questions right off - however, the simpleboard stripped out the XML you posted. If you could try posting it again, I would appreciate it.

1- Right now, the result-type tag is only used for our demonstration UI. The demonstration UI uses the result-type to build what belongs on a particular page - for example, a result-type of report will be able to be displayed on the reports tab. If there's an action sequence without the specified result-type in that part of the solution, it won't be displayed in the demonstration UI.

2a- I think you understand things pretty well (although I can't see the XML). Here's the deal on inputs:

*- Inputs defined at the document level give you the ability to define the source of the input and default values for those inputs. An individual action can only access inputs that are defined within the individual actions' action-inputs. This provides the ability to hide inputs that are available to one action from another action.

*- The mapping is there to allow you to map one input name to another input name if the expected input names by the component are different than you've named them throughout the sequence. For example - the E-mail component is looking for a defined input called "to". However, in your action sequence, you have an input called emailTo. The mapping allows us to recognize that "emailTo" is the input that the E-mail component needs called "to".

2b- I'm not sure I understand the nature of this question, but I'll take a shot. When an action starts, the inputs it requires must be present, or a parameter UI will be presented to gather those inputs (in most cases). When the action completes, the outputs should have been set by the component. A component can (and often does in our samples) create transient outputs that can be used as inputs to an action below it. These are not defined as inputs that can come from the outside world, but instead are inputs that are generated as outputs first. For example - consider an action sequence that receives an input from the URL (request) just that has ZIP code. However, you have a query that requires city and state. The inputs at the top of the document would include zipCode (coming in on the request as zc let's say). Then, lower in the action sequence, you have an action that takes zipCode, and runs a javascript rule (or query, or whatever) to resolve the zipCode into a city and state.

I hope that makes sense.

3- Typically, an action sequence executes from beginning to end, unless there's an error. In the case of server-side input checking, we have a few strategies for that which aren't necessarily pretty, but are functional. We're adding the ability to perform full-out control flow within the action sequence in a release coming to you soon.

Here's the reason it hasn't been in there before:

Since the beginning, we've had the philosophy that real control flow should be handled by a workflow engine. The action sequence is just a smallish cog in the wheel of an encapsulating process. However, we're seeing that most people don't want to bring the full power of a workflow engine to bear in their solutions. Instead, they want action sequences to do more and more work, obviating the need for full workflow unless they have multiple user-action steps along the way.

We've been pretty careful to avoid the slippery-slope of becoming a workflow engine by not implementing control flow within the action sequence. However, based on community feedback, we're pretty much convinced that we need to add some control flow, but we need to be sure not to slide any further down the slope. Otherwise, we'll be defining YAWD (yet another workflow definition) - and that's not our focus.

I hope this explanation makes things a bit more clear.

Take care,

Marc

spmva
05-26-2006, 12:05 PM
I'd love to re-post the xml, but I don't remember what I wrote. Anyway, I think that your explanation makes sense for the parts to which that example applied. Your response seemed to confirm my understanding already.

As for question 2b, some other things got cut out which made the question not make sense (funny it worked ok in preview...i don't think this board likes less than and greater than signs). Here's 2b again in full:

2b. I understand that values set in the <outputs> section are values that will be set by the time the entire sequence is completed. Are those values set by creating an action-output of the same name and type within an action-definition?

As for your response to item 3, I'm excited to hear that you will be implementing some flow control. I'd be happy with something lightweight and certainly understand the slipperly slope situation. That's why I softened my question a little bit as i didn't want to offend anyone's philosophical concepts of what the action-sequence should be. I'll just keep pulling workarounds until then.

As I mentioned in my last post, I'm getting more and more realistic in terms of what I'm trying to accomplish with pentaho. I'm even finding myself getting more comfortable with the source code itself and have envisioned some additions that would be of benefit to me (and other, I suspect...we discussed that one with the session cache in an earlier post). Is there a public CVS from which I can grab the most recent cut of the code? Even though I'm wouldn't be committing, it makes it so much easier to keep track of code changes if those little CVS icons are lit up. I didn't see a link on sourceforge.

Thanks,

Steve

mbatchelor
05-26-2006, 01:47 PM
Steve,

For public source code control, we'll be opening up our SVN to the public within three weeks (according to the build guy). We're working on it!

For 2b, mostly the sequence output is expected to be the final sequence result. This can be set by any of the actions along the way, or the last action in the chain.

For flow control, I've built a prototype of a conditional-execution node that uses javascript for determining whether a specific action should be executed. It works great, but I need to work with the other architects to make sure that it should really go live - the bottom line there is - whatever we do in this area will likely have to live on forever. If any of us are dissatisfied with it in principal, then now is the time to address it. We'll keep the community posted.

Take care,

Marc

dmoran
05-30-2006, 01:43 PM
Steve,

There is a way to stop the Action Sequence (sort of) - You can use the looping action to block out the rest of the actions in your sequence. Use a JavaScript rule to output a string-list of size 0 or 1. The loop will not execute if the list is zero sized.

For more details see:
http://forums.pentaho.org/showthread.php?t=26389

Doug

Post edited by: dmoran, at: 05/30/2006 17:44

spmva
05-31-2006, 02:23 AM
Thanks, Doug. Neat workaround. I never would have thought to have looked under the reporting features topic for that.

Steve

radek
06-05-2006, 02:00 AM
Hi Marc

Marc Batchelor wrote:


For public source code control, we'll be opening up our SVN to the public within three weeks (according to the build guy). We're working on it!

When we opened our svn to public we found that Trac is a pretty cool project as it allows to easly follow changes in the code and manage bugs in application: http://trac.edgewall.com/

Best regards,
Radek

spmva
06-29-2006, 04:44 AM
Just tried the ConditionalExecution as released as part of 1.1.7. I like how it works. It's simple and lightweight, yet presents a good deal of flexibilty since it is Javascript driven. Thanks for the addition!

Steve

maikelseret
06-29-2006, 06:39 AM
I'm also trying conditional, but it always pass as the condition were true. I don't know much about jscript but google helps me.
I've tried simple things like
1==1
or
1==2
Can you send me a short sample of a condition statement?

Thanks for your time.

Miguel

spmva
06-29-2006, 07:00 AM
I've attached my extra trivial example. It takes one parameter, "xxx", which if set to "ttt" will yield one result, otherwise if set to anything other than "ttt" will return a different result.

I said it was trivial...but it worked!

Steve http://forums.pentaho.org/archived_att/files/TestIf.xaction

Post edited by: spmva, at: 06/29/2006 11:01

maikelseret
06-29-2006, 11:38 PM
Thanks for your time. Now it works fine.
I must say that I'm really fool. I updated the plattform in a wrong way so the if statment wasn't work yesterday. Now I`ve solved the problem and tested your solution and it works.

Thanks a lot.

Miguel

mbatchelor
06-30-2006, 07:04 AM
You can simplify the "if" even more:

Instead of:


if (xxx == "ttt"«»){true;}else{false;}


Simply have this:



xxx == "ttt";


Believe it or not, that's all you need.

Take care,

Marc