A Scheduler is a Workflow, but a Workflow is an Action and Trigger
There is more to maintaining a blog than writing stuff to share and hope someone reads it. The time involved, the technology to make it happen, the not to mention the shameless promotion. This blogthingee is about the tech behind the drop that gets some of the work done for you.
[inline:threeheads.jpg]
My goal this time was to create a blog post... this blog post you are reading right now, and not publish it right away. I want to wait a few days until it gets published, and I want it to publish in it's own (with the help of his friend CRON of course). Second, because I want to make sure it was posted, I want to be sent an email, yes... by my blog, that says... "cool man, it's posted", really, that's what the message body of the email I get says.
So, here on blogthingee, the official blog of webthingee.com, we use Drupal (referred to as the drop above). Drupal 6 to be specific. To accomplish this task I took three paths, one I thought was a for sure, one that didn't work, and one that (if this blog is posted and you are reading it), one that did. Here en lies my journey... (in summary form)...
[inline:deepinthought.jpg]
What I Thought Was Going To Work
I have used scheduler module for a few different things. the scheduler modules is great at, well scheduling. I was not able to find an easy solution to integrate it with sending me an email when it was updated I realize there are potential options for this including rss, notification, cron, etc... but I was looking for a bite size solution that was also scalable as well as inside Drupal. After installing, getting it working for a few posts, and using it briefly, I realized that in this situation, it was not going to be right for my needs.
The One That Didn't Work For Me (but a valuable learning experience)
I decided that I needed to use actions and triggers to get this done. I tinkered around with both for a while and saw what I could do. There are many options and understanding exactly what you want to have happen, and what the triggers and actions are responsible for can take a minute to grasp. It's a paradigm realization that needs to occur, as it is with most of the Drupal modules. The advantage (the more minds, the more open to ideas, the better the results) and disadvantage (takes time, experience, and patience to keep pace) to this superb open source framework. This experience learning about triggers, actions, and how they were also working with things like tokens, was very valuable knowledge, but my ultimate solution was not yet within grasp.
[inline:workflow.jpg]
The Path To Workflow
This lead me to the workflow module. I followed the walk through at Basic publishing workflow with Drupal 6 and was able to open my eyes to an amazing breath of air in understanding the interrelationships between these powerful modules. This step by step walk through helped me see that if I was going to have a robust and clean solution, workflow was going to be my friend.
The One That Worked...
The ultimate solution for me is to use workflow, actions, and triggers, with some interesting token usage thrown in. Luckily, there is no need for me to type a long and involved instruction list here because Sean Buscay knocked this one out of the park with his tutorial at Building a Publishing Workflow with Scheduled Transitions at Node Creation, a terrific walk through that I used to complete my current system for automatic posting.
Here is a view of the "scheduler section of the node" using this method.
[inline:workflowscreen.jpg]
I adjust the author info to match so the post has the same info.
[inline:authorinfo.jpg]
Why This One
- In general I like solutions that leave room for other solutions. By using Buscay's approach I have tons of flexibility for changing and building upon the current workflow for the given situation.
- The build in /workflow/pending page is very cool.
- Learning to use workflow in this way opens the door for other similar uses.
- It's non-complex to re-produce and use elseware.
- Workflow is a multi-tasker vs. scheduler is a uni-tasker (thank you Alton Brown - cooking channel).
- I am hoping to incorporate my twitter feed and post it there as an action as well.
