History: GalaxiaWorkflowDev
Preview of version: 6
We have a good activity-based Workflow engine. We need to build a team to test/debug/improve Galaxia. We need to gather a collection of workflow apps which can easily be downloaded and installed on Tiki sites.
please add your name here!
1.7 Galaxia: Dynamic Mapping of Users/Groups to Role
Galaxia is the only (AFAIK) PHP based open source activity WorkFlow.
noen yet
none yet
Since Galaxia looks like a good piece of work still waiting to really take off, I tried using it for a workflow module in Xaraya. Here's a little summary of that experience, in case anyone else is thinking of re-using Galaxia outside of TikiWiki.
- overall, you can simply copy the lib/Galaxia directory and get started (use the CVS version for this, and not 1.7.1.1)
- you'll probably want to replace all hard-coded lib/Galaxia paths with some GALAXIA_DIR constant, to place the Galaxia lib anywhere you want
- table names are hard-coded all over the place, so if you want to keep some common table naming convention or have several instances working on the same database, you'll need to add some GALAXIA_PREFIX or replace the table names with configurable variables
- processes are stored in lib/Galaxia/processes/*, and templates are also copied to templates/*. For the future, you'll probably want to make the directory paths configurable, and also define whether templates need to be copied elsewhere or not
- the Galaxia lib is pretty much CMS-agnostic overall as long as you work with ADODB, but it still references some of TikiWiki's specific environment ($smarty, DB::isError, tra(), $style_base) in the error handling sometimes. So you'll want to create some fake tiki-setup.php that simulates those with whatever equivalent you use
- regarding ADODB, you may need to define('DB_FETCHMODE_ASSOC', 2) and do a $db->SetFetchMode(DB_FETCHMODE_ASSOC) before you pass the database handler to Galaxia
- if you don't use Smarty, the only little issue besides the display of errors (see above) is that the Galaxia lib automatically adds {*Smarty template*} at the top of new templates - easy to customise if necessary
- file read operations typically rely on a single fread(...,filesize(...)) call, which often fails to retrieve the complete file on some platforms (e.g. Windows), so that code/template updating is unreliable. And if you do your own PHP error handling, you'll probably want to verify all @ operations and add the approriate file or directory checking.
- in src/API/Instance.php, non-interactive activities are executed by making an external web call to tiki-g-run_activity.php. You'll want to replace that with some API function call, or whatever is most appropriate for your environment. For the future, Galaxia should probably call some external function with a predefined name here, and let each CMS/environment provide that function then
In short, pretty good re-usability overall - you should count about 1 day to handle any portability issues for the Galaxia library itself.
If you want to re-use the tiki-g-* scripts and templates from TikiWiki as well, to get you started on the GUI side of things, you'll need to :
- specify the current user in $user
- create some fake Userslib that can handle get_users(), get_groups() and get_group_users() calls, and provide a global $userlib variable
- provide global $tikilib and $dbTiki variables pointing to your db connection
- set $maxRecords and some $feature_* and $tiki_p_* variables as well
- insert stripslashes() in a few places in case magic quotes are on, and htmlspecialchars() when templates are being edited
Integrating the scripts, converting the templates and getting things to work overall may take another day or so depending on your environment.
I hope that my modest contribution can help a bit in spreading the use of Galaxia to other PHP environments. It's a great piece of work 😊
History
| Information | Version | |||||
|---|---|---|---|---|---|---|
| drsassafras Mass search and replace | 13 | |||||
| Marc Laporte | 12 | |||||
| mikespub | 11 | |||||
| Philippe Cloutier Added RFE tracker | 10 | |||||
| Philippe Cloutier Added RFE tracker | 9 | |||||
| Dayton Clark | 8 | |||||
| mikespub | 7 | |||||
| mikespub | 6 | |||||
| Marc Laporte | 4 | |||||
| Marc Laporte | 3 | |||||
| Jeremy Butler | 2 | |||||