No, I didn't code anything - we're just changing Categ by hand.
I'm not sure you'd have to hard-code adding/changing buttons, hiding categ... That's probably some smarty thing - but I'm not sure...
"differents groups of users can have differents validators" : do you mean in *same* workflow, some kind on conditional validator ? Or can you just say "User A starts a Workflow_Z instance", so you "know" it will route through Step1_Z, Step2_Z, Step3_Z ?
My basic wflow architecture:
Workflow table : Code ("News"), Label ("Corp News"), Version ("1"), group(s) allowed to create.
Steps table : each step has a Workflow_Code ("News"), Code
("News_Create", "News_Valid_Content", "News_Valid_Look"...) , Label ("News Validation").
Note that
Workflow destinations are not coded in the steps, but in their actions.
Actions table : WFlow code ("News"), Step ("News_Valid_Content"), Number (1,2,3... so they be shown in this order), Label ("Validate Content for this News" - so you can generate buttons), Destination_Step, Allowed_Users_for_Next_Step, Hide_Condition, Mail_To_Send.
Mails table : Mail_Code, Subject, Content - for those two, would be fine to have some smarty and/or formula evaluation...
My favorite trick :
for each Action, Destination_Step, Allowed_Users and Hide_Condition are
evaluated at run-time. So, for Dest_Step : you can decide to code & store in the db:
- "News_Valid_Look" ('direct notation')
- or some kind of this (this is only pseudocode, probably wouldn't work !!) :
Code: Select all
if (some_special_condition = true) {return "ThisDestStep"} else {return "ThatDestStep")
For Allowed_Users, you can set same kind of mechanism to decide to "send" to one/many groups, users...
For Hide_Condition, you can use it to hide the Validation button on 1st April... or if FieldAmount is negative.
This allows to test & decide anything.
The code "knows" which is current step_code and wflow_code, looks for all possible buttons, evals if they're to be shown & their order, and prints them...
But I have NO idea so far about how to create fields on wflow "Pages", and then how to eval them (I mean, to get them back in the code). I'm still thinking about using QCodo (php5 only), but didn't try yet.
As it's for a contract, you'll perhaps have time & money to code it ! Hope you'll be able to share...
Thats All Folks...
...Or perhaps there's a good php wflow engine out there to embed...
HTH !