Packages
form
11.4.14
11.4.15
11.4.14
8.3.0
8.0.0
7.10.0
7.8.0
7.7.0
7.6.2
7.6.1
7.6.0
7.4.2
7.4.1
7.4.0
7.1.0
6.11.1
6.10.7
6.10.6
6.10.5
6.10.4
6.10.2
6.10.1
6.4.0
5.12.1
5.12.0
5.8.7
5.8.6
5.8.5
5.8.4
5.8.3
5.8.2
5.8.1
5.8.0
5.7.0
5.5.0
5.3.4
5.3.3
5.3.2
5.3.1
5.3.0
5.1.10
5.1.9
5.1.8
5.1.7
5.1.6
5.1.5
5.1.4
5.1.3
5.1.2
5.1.1
4.12.3
4.12.2
4.12.1
4.12.0
4.11.15
4.11.14
4.11.13
4.11.12
4.11.11
4.11.10
4.11.9
4.11.8
4.11.7
4.11.6
4.11.5
4.11.4
4.11.3
4.11.2
4.11.1
4.11.0
4.10.5
4.10.4
4.10.3
4.10.2
4.10.1
4.10.0
4.7.0
4.6.0
ERP/1 X-FORM Business Cartulary
Current section
Files
Jump to
Current section
Files
README.md
FORM: Declarative Documents
===========================
[](https://github.com/synrc/form/actions)
[](https://hex.pm/packages/form)
Intro
-----
```erlang
#document { name = Name, sections = [
#sec { name=[<<"Input the password "
"you have received by SMS"/utf8>>,
nitro:to_list(Phone#phone.number)] } ],
buttons = [ #but { name='decline',
title=<<"Cancel"/utf8>>,
class=cancel,
postback={'CloseOpenedForm',Name} },
#but { name='proceed',
title = <<"Proceed"/utf8>>,
class = [button,sgreen],
sources = [otp],
postback = {'Spinner',{'OpenForm',Name}}}],
fields = [ #field { name='otp',
type=otp,
title= <<"Password:"/utf8>>,
labelClass=label,
fieldClass=column3}]}.
```
Spec
----
Documents or Forms consist of set of fields grouped
in sections and a row of control buttons.
It mey also contain fields of customizable types.
```erlang
-record(document, { ?ITERATOR(feed),
name,
base,
sections,
fields,
buttons,
access }).
```
```erlang
-record(field, { id, sec=1, name, pos, title,
layout, visible=true,
disabled=false, format="~w",
curr=[], postfun=[], desc,
wide=normal, type=binary,
etc, labelClass=label,
fieldClass=field,
boxClass=box,
access, tooltips=[],
options=[], min=0, max=1000000,
length=10, postback }).
```
```erlang
-record(sec, { id,
name,
desc="" }).
```
```erlang
-record(but, { id,
postback,
name,
title,
sources=[],
class }).
```
```erlang
-record(sel, { id,
postback,
name,
title }).
```
```erlang
-record(opt, { id,
postback,
name,
title,
checked=false,
disabled=false,
noRadioButton=false }).
```
```erlang
-record(validation, { name, type, msg,
extract = fun(X) -> X end,
options=[], function,
field={record,pos} }).
```
KVX Data Model
--------------
The Metainformation is used to generate KVS Data Model.
The [KVS](http://github.com/synrc/kvs) layer provides persistence.
NITRO Applications
-----------------
JavaScript Web Application is generated using Metainformation and Data Model.
[N2O](http://github.com/synrc/n2o) is used as a domain specific language to generate forms.
JavaScript/OTP is used to generate form. Average rendering speed is 25 forms per second.
Erlang and JavaScript/OTP are used to define validation
rules applied to documents during workflow.
BPE Processes
-------------
Workflows are complimentary to business rules and could be specified separately.
[BPE](http://github.com/synrc/bpe) defenitions provide front API to end-user applications.
Credits
-------
* Maxim Sokhatsky
OM A HUM