Page 1 of 1

We're testing ability to add Custom Workflows

Posted: Tue May 16, 2006 3:52 am
by calguy1000
I just thought I'd try to get some user feedback on this.

We've tentatively added (into svn) some new methods into the module api.  to allow a) listing all of the user defined tags, and b) calling a user defined tag by name.

The idea with this, is that each module could create code such that on a certain event, a user defined tag is called, which would allow you to create a workflow.

For example, when a file is uploaded to the Uploads module, you could associate a plugin with that event that creates a news article. 

or, when a comment is added via the comments module (hook yet to be written), write your own custom email message to be sent to an admin/

or whatever series of events you wanted to happen.  All you would need is an understanding of php, and some understanding of the module api, and the api of the modules you wanted to work with (if any).

i.e.: if a user tag was created called "create_news_on_upload" that did something like (syntax not exact, we still have some things to do):

Code: Select all

$news = $gCms->getModuleInstance(*News");
$news->AddArticle( $params['upload_category'], "The user ".$params['upload_author']." has uploaded ".$params['upload_name']." you can get it here ".$params['upload_link'] );
And this user tag was associated with the "onupload" event in the Uploads module, a new news article, could be added each time a user uploaded a file.  This is just an example, the possibilities are endless.

What do you think?

Re: We're testing ability to add Custom Workflows

Posted: Tue May 16, 2006 3:55 am
by Elijah Lofgren
This sounds VERY cool. I like it!  ;D

Re: We're testing ability to add Custom Workflows

Posted: Tue May 16, 2006 4:15 am
by calguy1000
there's nothing limiting this to modules either, technically speaking, once this idea is proven, it could be added to the core, so that, for example, you could write a user tag, and associate it appropriately, such that every time a new page was added (for example) to the content, a special administrator was sent an email.

or you could implement your own version control methodology, backups, etc, etc, etc.

Re: We're testing ability to add Custom Workflows

Posted: Tue May 16, 2006 5:47 am
by Russ
Yes I like it!

Russ

Re: We're testing ability to add Custom Workflows

Posted: Tue May 16, 2006 1:14 pm
by lemkepf
Yea, i like that, escpecially the being able to utalize the core events. "This user just added a page, send me an e-mail so i can check it out". Score. :)

Re: We're testing ability to add Custom Workflows

Posted: Thu May 18, 2006 2:59 am
by calguy1000
Well, it's been tested.  The uploads module now has an event that gets called when a new file is uploaded, it creates some parameters, and calls a user specified, user defined tag.  The user defined tag I wrote, would create a news article about the new upload.

As well,  I tested writing a user defined tag that called an action in a module.  This action, could theoretically generate another event.

This means that everybody using cms with a bit of php knowledge, can create their own custom workflows.  All it needs is for the module developers to send the events and allow you to specify the user tag to be called.

We've also been discussing some tentative additions for the 0.14 series that will centralize the event handling stuff on one page, so that administrators can see what events are available to be "trapped", and can then associate (or de-associate) user tags there.  We'll also probably be adding some more api functions to "Register" events, unregister them, and Send them.  The send would then lookup which tag should be called, if any, and call it with the module supplied parameters.

I think that this workflow stuff is going to put CMS over the top for it's ease of use, and customizability.

Any questions, comments, or suggestions?

Re: We're testing ability to add Custom Workflows

Posted: Thu May 18, 2006 5:16 am
by Russ
I'm really looking forward to this. I think the important thing to remember is that we make it optional. It maybe complicated for less experienced users, but they don't have to do it. Workflow is complex and individual, that will not change, we can however provide some good building blocks for people to use if they want. Documentation may well be more important :-)

Remember the 80/20 rule. CMS should do the 80 not the 20 - but could provide the hooks for others to build the 20 if they need.

Russ

Re: We're testing ability to add Custom Workflows

Posted: Thu May 18, 2006 9:50 am
by Ted
Russ wrote: Remember the 80/20 rule. CMS should do the 80 not the 20 - but could provide the hooks for others to build the 20 if they need.
Wow.  I've said almost the exact same thing in the past.  I like the way you think.  :)

And, yes, I agree with this.  I love the idea of having places where people can expand on the system once they "get it".  It really makes people plesantly surprised after they've been poking around for awhile.  Something like this is a prime example.