Domain-Specific Language for Generating ...

8 downloads 0 Views 589KB Size Report
Antonio García-Domínguez, Ismael Jerez-Ibáñez and. Inmaculada Medina-Bulo. July 8th, 2015. A. García-Domínguez et al. Domain-Specific Language for ...
Intro Proposal Results Conclusions

Domain-Specific Language for Generating Administrative Process Applications Antonio García-Domínguez, Ismael Jerez-Ibáñez and Inmaculada Medina-Bulo

July 8th, 2015 A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

1 / 12

Intro Proposal Results Conclusions

Motivation

Situation Univ. of Cadiz (Spain), IT webdev+support group (5-8 people) Need to handle demand for many “small” internal apps Similar needs: data collection and simple processes Restrictions Varied backgrounds: recently standardized on Python/Django Limited time/budget for training/consulting Developers are moved frequently between apps

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

2 / 12

Intro Proposal Results Conclusions

Existing approaches

Full-fledged BPM systems (e.g. Bonita) Pros: standards-based (BPMN), general-purpose Cons: complexity, dependency on engine, seemingly “minor” customizations are costly Domain-based code generators (e.g. EMF Forms / Apache Isis) Pros: simpler, easier to customize Cons: do not take into account the underlying process

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

3 / 12

Intro Proposal Results Conclusions

Proposed approach: process category-specific DSL

Modelling requirements 1

Manage both domain and process

2

Provide role-based access control per process state

3

Support decision- and date-based transitions

4

Support process isolation between users with same roles

Technical requirements 1

Allow generator-specific annotations

2

Manageable with regular editors and VCSs

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

4 / 12

Intro Proposal Results Conclusions

Example: examination process site School;

Steps

options { . . . }

1

Student starts process

role student; role teacher;

2

Exam is in 2 parts

3

Part 2 opens after date

4

Evaluation by teacher

5

Exam closed, read-only

process exam { entity Ans3 { . . . } section personal { . . . } section test { . . . } section evaluation { . . . } state state state state state

initial { . . . } part1 { . . . } part2 { . . . } evaluation { . . . } closed { . . . }

Implementation Parser + editor: Xtext Code generator: Epsilon Target framework: Django

}

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

5 / 12

Intro Proposal Results Conclusions

Example: examination process options { django_base_template = "template/base.html"; django_extra_apps = "template = https://.../"; }

site School; options { . . . } role student; role teacher; process exam { entity Ans3 { . . . } section personal { . . . } section test { . . . } section evaluation { . . . } state state state state state

initial { . . . } part1 { . . . } part2 { . . . } evaluation { . . . } closed { . . . }

Site-wide generation options Key-value pairs Keys not restricted by grammar Allows generators to provide extra functionality

}

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

5 / 12

Intro Proposal Results Conclusions

Example: examination process entity Ans3 { string answer; }

site School; options { . . . }

Data entities Objects that can be reused across process instances

role student; role teacher; process exam { entity Ans3 { . . . } section personal { . . . } section test { . . . } section evaluation { . . . } state state state state state

Can be site-wide or process-specific Example: possible answers for question 3

initial { . . . } part1 { . . . } part2 { . . . } evaluation { . . . } closed { . . . }

}

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

5 / 12

Intro Proposal Results Conclusions

Example: examination process section personal { fullName studentname; identityDocument(label="National ID:") nid; email(label="Email") mail; }

site School; options { . . . } role student; role teacher; process exam { entity Ans3 { . . . } section personal { . . . } section test { . . . } section evaluation { . . . } state state state state state

initial { . . . } part1 { . . . } part2 { . . . } evaluation { . . . } closed { . . . }

Sections Divide the form for access control or presentation. Fields Types are domain-specific, beyond those of the framework “fullName”: forename, last name

}

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

5 / 12

Intro Proposal Results Conclusions

Example: examination process site School; options { . . . } role student; role teacher; process exam { entity Ans3 { . . . } section personal { . . . } section test { . . . } section evaluation { . . . } state state state state state

initial { . . . } part1 { . . . } part2 { . . . } evaluation { . . . } closed { . . . }

section test { group part1 { string(blank="True") q1; choice(values=". . . ",blank="True") q2; choice(table="Ans3",blank="True") q3; } group part2 { . . . } ... }

Groups Contain one or more fields. Optionally, can be repeated (e.g. order line items). Also useful for access control.

}

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

5 / 12

Intro Proposal Results Conclusions

Example: examination process state initial { permissions student { editable personal; } transition(decision_by="student", start_date="2015/03/01−14:00:00", end_date="2015/03/07−14:00:00", max="1") part1; }

site School; options { . . . } role student; role teacher; process exam { entity Ans3 { . . . } section personal { . . . } section test { . . . } section evaluation { . . . } state state state state state

initial { . . . } part1 { . . . } part2 { . . . } evaluation { . . . } closed { . . . }

Initial state Implicit state while unstarted Who can start the process, when and how many times? Here, students could start the process once from March 1st to March 7th at the part1 state

}

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

5 / 12

Intro Proposal Results Conclusions

Example: examination process state part1 { permissions teacher { viewable all; } permissions student from initial→part1 { editable personal, test.part1; } transition(start_date=". . . ") part2; }

site School; options { . . . } role student; role teacher; process exam { entity Ans3 { . . . } section personal { . . . } section test { . . . } section evaluation { . . . } state state state state state

initial { . . . } part1 { . . . } part2 { . . . } evaluation { . . . } closed { . . . }

}

A. García-Domínguez et al.

Permissions per state + role View or edit form data Delete process instance Optional: required transitions Restrict to participants of a specific transition in that instance.

Domain-Specific Language for Generating Administrative Process Applications

5 / 12

Intro Proposal Results Conclusions

Generated website: main page

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

6 / 12

Intro Proposal Results Conclusions

Generated website: full form

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

7 / 12

Intro Proposal Results Conclusions

Generated website: generated code Metrics DSL-based description: 66 lines long Produced: 1000+ lines of Python code 400+ lines of HTML templates 264 lines of docs/support scripts

Features Generates models, views and controllers Generates process-oriented UI as starting point Partial form saving (drafts) Integrates useful Django features (admin panel, data versioning, chained selectors, i18n...) A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

8 / 12

Intro Proposal Results Conclusions

Current status Availability In-house with IT staff and local contractors Currently used to prototype four internal apps: Budget plan tracking Degree improvement plan tracking Job postings management Strategic plan definition/tracking

Maturity Metamodel mostly stabilized, but not frozen yet Editor is being refined with OCL constraints Generator verified through automated functional testing Collaborating with users on defining “protected regions” A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

9 / 12

Intro Proposal Results Conclusions

Conclusions

Proposal Small IT group working on repetitive web apps General purpose BPM engines too complex, form-based frameworks do not consider the processes Proposed middle ground: a process category-specific DSL Results obtained DSL (parser + editor) implemented through Xtext Code generation with Epsilon targeting Django Being used currently to develop four in-house apps

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

10 / 12

Intro Proposal Results Conclusions

Future work Improvements on DSL State preconditions/postconditions Nested groups Improvements on tooling Extend current Xtend validation with OCL Create more generators (Symfony2, BPMN?) Graphical visualizations of the process Create graphical editor (backed by DSL instead of XMI) Validation Refinements based on user feedback Planned open source release in summer/fall 2015 Future studies on productivity/usability A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

11 / 12

Intro Proposal Results Conclusions

End of the presentation

Thank you for your attention @antoniogado, @antoniogado_es

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

12 / 12

Abstract syntax — Application

Application

Element [0..*] elements

Site

Options

name : EString

Role name : EString

Process name : EString

Entity name : EString

[0..*] elements Option name : EString values : EString

A. García-Domínguez et al.

[0..*] properties

Domain-Specific Language for Generating Administrative Process Applications

12 / 12

Abstract syntax — Process

Process name : EString

Section name : EString

A. García-Domínguez et al.

ProcessElement [0..*] elements

Entity name : EString

Relation relname : EString

State name : EString

Domain-Specific Language for Generating Administrative Process Applications

12 / 12

Abstract syntax — Sections/Entities Section

Entity

name : EString

name : EString

[0..*] elements SectionElement

[0..*] elements EntityElement

name : EString

Group

Field [0..*] elements

type : EString

Relation relname : EString

Option [0..*] options [0..*] options

A. García-Domínguez et al.

name : EString values : EString

[0..*] reloptions

Domain-Specific Language for Generating Administrative Process Applications

12 / 12

Abstract syntax — States State name : EString

[0..1] to [0..1] from [0..1] name

[0..*] elements StateElement

Transition

Permission type : EString

RolePermissionsDef [0..*] permissions

PermissionWithTarget

RequiredTransition [0..*] transitions

PermissionAll

Points to section, group or field.

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

12 / 12

Abstract syntax — Relations Relation relname : EString

RelationTarget [0..*] targets

ProcessOrEntity

RelationReferenceTarget

LiteralClass value : EString

[0..1] target

[0..1] tail SectionOrEntity

RelTailRef [0..1] element

[0..1] tail Group

RelTailRef2 [0..1] element

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

12 / 12

Example: examination process state closed { permissions teacher { viewable all; } permissions student { viewable evaluation; } permissions student from initial→part1 { viewable all; } }

site School; options { . . . } role student; role teacher; process exam { entity Ans3 { . . . } section personal { . . . } section test { . . . } section evaluation { . . . } state state state state state

Final state(s) States with no outgoing transitions

initial { . . . } part1 { . . . } part2 { . . . } evaluation { . . . } closed { . . . }

}

A. García-Domínguez et al.

Domain-Specific Language for Generating Administrative Process Applications

12 / 12