First you have to understand that we implemented something called a finite statemachine. If you don't know what this is then take good books on theoretical computer science or ask some professors. Second you have to understand our implementation :) Ok, you have only to understand the configuration. A finite statemachine consists of states and state transition functions (German: Zustandsuebergangsfunktionen).
All known states are stored in OPENCADIR/etc/bp/states.txt. You can change this filename like every other filename too in OPENCADIR/etc/bp/bp.xml. All known functions are stored in OPENCADIR/etc/bp/functions.txt. The startconfiguration of states which causing a function to start it's actions are stored in the directory OPENCADIR/etc/bp/functions. The filenames are function_name.txt. Every line contains one state which is required to start the function. Every process of a user has a configurationfile states.txt which represents the actual state of the user. It has the same format like the configurationfiles of the functions.
Visualize the state-transition graph.
Mark the changes in the graph.
Create OPENCADIR/etc/bp/states.txt which must include all possible states.
Create OPENCADIR/etc/bp/functions.txt which includes all available batch functions.
Create the start configuration of the states for all batch functions in OPENCADIR/etc/bp/functions.
Check that the start configuration specified in OPENCADIR/etc/bp/functions are conflict free.
Please perform the last step twice if you change an already running system to ensure that you don't remove a state which is already present in the system and that you are able to still handle all states.
Implement the new and change the old functions.
Test the new system before deploying it.
Add the function to the list in OPENCADIR/etc/bp/functions.txt.
Create the file OPENCADIR/etc/bp/functions/function_name.txt and specify the start configuration of the states there.
Create the OPENCADIR/lib/bp/function_name.sub by copy and paste from another batch function.
Change the function name in the file function_name.sub to workflow_function_name.
Change the source code of the function to do what you want. The function get two parameters - USER and WORKFLOW. You can use these parameters to access the data in the batch system.
Finally you have to change the actual state configuration of the workflow.