I'm searching for an way to language independently express the workflow of an HTML application. If a user fills in certain values in a form, another form should be displayed. Further if values are filled in, in this child-forms new parts of these child-forms should be shown.
I want to express relationships between HTML forms, HTML elements in these forms and values of these elements.
Based on database information, like table fields and table relationships, I manage via Doctrine, I generate ExtJS forms.
Now I have to introduce some flow logic into my ExtJS forms, in a way that I don't hard code the application flow with ExtJS (JavaScript) code directly.
I want to generate the appropriate JavaScript code on runtime, based on a predefined configuration file.
For instance:
I have X forms
FORM 1. (displayed on startup)
|
|-> FROM 1.1 (only display after values have been inserted into FORM 1.)
|
|-> FROM 1.2 (only display after values have been inserted into FROM 1.1)
|
FROM 2. (display when something inserted into FORM 1.)
|
|-> FROM 2.1 (layout and elements of this form depend upon what has been
inserted into FROM 1.)
....
Furthermore I only want to display parts of the forms if the user filled something in an input field
FORM 1. (displayed on startup)
|
|-> LAYER 1. (only display/activate after field <count> of FROM 1.
| has been filled in)
|
|-> LAYER 2. (only display/activate after field <count> of LAYER 1.
| has been filled in)
|
....
Then I want to display forms only if the value the user filled in a form element passes a predefined condition
FORM 1 (displayed on startup)
|
|-> FROM 1.1 (only display if field <count> of FROM 1. is greater that 10
| count > 10)
|
|-> FROM 1.2 (if count < 10 display this form)
|
....
Last I want, based on values the user inserted in a parent form, set rules for input elements to restrict their input range (possible values)
Here is a example workflow
Is there already a metalanguage to define relationships like that?
What would be your approach to realize something like that?
Regards,
J.
What I would do is start from other tools/projects that use a similar setup in another domain and see if you can apply techniques of it to your own domain.
For instance, take a look at Cucumber (http://cukes.info/). Cucumber is a behaviour driven development tool that is aimed at functional testing of an application. It uses a human readable test syntax. Another one is Selenium (http://seleniumhq.org/) in which Interface interactivity is described in a domain specific language.
Hope these two give you some inspiration for your solution, good luck
Rob