1. Creazione di un DSL per definire
processi di Negoziazione
(e generazione codice eseguibile)
Il progetto Open Negotiation Environment
Giulio Montanari, Soluta.Net
4. 4
www.soluta.net gmontanari@soluta.net
What a Negotiation is
From UniSG, ONE Partner
“Negotiation is a process during
which two or more entities try to
reach a mutual acceptable
agreement on one or several issues
through some kind of
communication.”
Single/multilateral
Single/Multiple Issue
7. 7
www.soluta.net gmontanari@soluta.net
ONE Objective
''The main objective of the ONE project is to enrich Digital
Ecosystems with an open, decentralised negotiation environment
and enabling tools that will allow organisations to create contract
agreements for supplying complex, integrated services as a
virtual organisation/coalition''
''To solve these problems, a negotiation environment must be
affordable, open, not centrally controlled, support the sharing of
knowledge via flexible security and trust policies and be able to
learn and evolve with the changing market conditions''
to allow users to create and customized their own negotiation
models and to run them in a web/community based
environment
10. 10
www.soluta.net gmontanari@soluta.net
The component model
Factory
Environment
DKB
Security
Setup Execution
Trust&Rep
Recomm.
Announce
Publish
Eclipse Rich UI
Execute
Negotiation
Model
Web based UI Web based UI
Negotiation
ONE Node
Simplified
11. 11
www.soluta.net gmontanari@soluta.net
Deployment model
Participant
Participant
One Node
(Trusted Node)
One Node
(Negotiation Node)
One Node
(Trusted Node)
One Node
(Trusted Node)
One Node
(Negotiation Node)
Decentralized KB
One Node
(Trusted Node)
One Node
()rusted Node
Participant
Participant
Participant
Participant
Owner
One Node
(Trusted Node)
Negotiation A
Negotiation B
Decentralized KB
Decentralized KB
Owner
One Node
One Node
One Node
One Node
Note: A Trusted Node is a ONE Node just in a different role
P2P network
P2P network
12. 12
www.soluta.net gmontanari@soluta.net
MDA Abstraction layers
(M2)
(M1)
Negotiation Models
“expressions”
Negotiation Language
“syntax”
(M0)
Negotiation Data
“values”
MOF
“thing”
Abstraction
(M3)
higher
lower
DSL
Models
Data
13. 13
www.soluta.net gmontanari@soluta.net
Role of a DSL
Ease effort of creating model specific to a domain
Capture domain knowledge/store assets!
Terms like:
Acceptance, contraints, offer, counter offer, price, reduction,
admission, issue, discount, negotiations, agreement, owner,
participant,...
Actions like:
To admit, To offer, to agree, to rebate, to discount, to retract, to be
invited,...
A “template” for models creation
From a DSL many models can be created
Allow an high level of reuse of tooling which becomes model independent
No development in case of new models
Allow adaptability/flexibility
Increase the ROI
14. 14
www.soluta.net gmontanari@soluta.net
How to create a DSL?
1) UML/BPMN subset
UML is too complex, the effort requires does not allow
BPMN is not Negotiation specific, customization is required
Customization of a UML tool feasible
2) UML/BPMN Profile
Doable but not effective when creating a model
Hard to tailor an UML tool
Customization of a UML tool feasible
3) A new language (MOF or ECORE)
Hard to create
Very effective
A new DSL Editor has to be created
ONE Project decided for the 3rd
approach
15. 15
www.soluta.net gmontanari@soluta.net
Creating a DSL
Ok we know we have to create a MOF model, and now?
We decided to use Sparx System Enterprise Architect (a cost-effective
commercial UML Editor) which has the ability to create MOF models and to
export XMI 1.2, MOF 1.4 for reusability
Negotiation meta model created as instances of MOF
From the computable MOF metamodel through a series of transformation we
generate the executable code
16. 16
www.soluta.net gmontanari@soluta.net
ONE Metamodel: concept
class Negotiation Concepts
Negotiation
{leaf}
- id: String
- version: String
- creationDate: Date
- name: String
+ visibility: VisibilityKind
NegotiationElement
Item
NegotiationProtocol
{leaf}
Actor
- id: String
NegotiationType
{abstract}
NegotiationRole
{abstract}
NegotiationElement
Issue
NegotiationMessage
Agreement
«enumeration»
VisibilityKind
private
public
resolves
+issue 1..*
+issue 1..*
composed
of
+sub-issue
composedOf
0..*
+item 1..*
comprisedOf
specifies
+role 2..*
+protocol
1
executes
1
defines
+party2..*
defines
has
+role1
+negotiation 0..*
is
involved
+party 1..*
Name:
Package:
Version:
Author:
Negotiation Concepts
«metamodel» NegotiationMetaModel
1.0
WIT
SimplifiedResult of work of the Waterford Institute of Technology, Ireland
17. 17
www.soluta.net gmontanari@soluta.net
One Metamodel: Information MM
class Information MetaModel
NegotiationMetaModel::
Negotiation
{leaf}
Issue
NegRule::Criteria
NegotiationElement
{abstract}
- id: String
Attribute
- name: String
Types::Type
{abstract}Item
AttributeValue
NegRule::
NegotiationRule
{abstract}
has
+type 1
+value
+issue
1..*
composed
of
co-related*
+sub-issue
composedOf0..*
+criteria *
constrainedBy
*
+attribute
1..*
constrainedBy
+criteria
*
+item 1..*
Name:
Package:
Version:
Author:
Information MetaModel
«metamodel» NegInformationMetaModel
1.0
WIT
Simplified
class Facility Management Information Model
«Item»
BuildingCleaning
- id: String
«Attribute»
- name: String
- address: String
- type: String
«Issue»
Price
- id: String
«Attribute»
- price: int
Nam e:
Package:
Version:
Author:
Facility Management Information Model
Inform ation Model
1.0
WIT
Result of work of the Waterford Institute of Technology, Ireland
18. 18
www.soluta.net gmontanari@soluta.net
One Metamodel: Protocol MM
class Principal Negotiation Protocol Conceptsl
NegotiationProtocol
{leaf}
- id: String
- name: String
NegotiationMetaModel::
Negotiation
{leaf}
NegotiationMetaModel::
Actor
- id: String
NegotiationType
{abstract}
NegRole::
NegotiationRole
{abstract}
Behaviour
ProtocolBehaviour
{leaf}
SuperStage
Neg Stages::
Negotiating
{leaf}
PreNegotiation
Neg Stages::
Readiness
{leaf}
PreNegotiation
Neg Stages::
Admission
{leaf}
Ab stractStage
Neg Stages::
InitialStage
{leaf}SuperStage
Neg Stages::
Acceptance
{leaf}
AbstractStage
Neg Stages::
FinalStage
{abstract}
NegRole::
Participant
{leaf}
NegRole::
Owner
{leaf}
NegotiationElement
NegMessages::
NegotiationMessage
NegRule::
NegotiationRule
{abstract}
- id: String
- name: String
- expression: String
1
defines
contains
starts
from
1
starts
with
1
contains
1
contains
+behaviour1
specifies
1
1..3
terminates
at
+negotiation
0..*
is
involved
+party 1..*
+protocol 1
executes
specifies
+role
2..*
defines
1
governs
*
has
+role 1
Name:
Package:
Version:
Author:
Principal Negotiation Protocol Conceptsl
«metamodel» NegProtocolMetaModel
1.1
WIT
Simplified
class eTender Protocol Model
«NegotiationProtocol»
eTenderProtocol
- id: String
«Owner»
Owner
«Participa...
Participant
«ProtocolBehaviour»
OwnerProtocolBehaviour
- id: String
«ProtocolBehaviour»
ParticipantProtocolBehaviour
- id: String
«ProtocolRule»
NegotiatingTimeOutRule
- id: String
- expression: String
«ProtocolRule»
NegotiatingStartTimeRule
- id: String
- expression: String
«specifies» «specifies»
«governs»
«governs»
«specifies»«specifies»
Nam e:
Package:
Version:
Author:
eTender Protocol Model
Protocol Model
1.0
WIT
Result of work of the Waterford Institute of Technology, Ireland
19. 19
www.soluta.net gmontanari@soluta.net
The protocol model
A class diagram models also a state
diagram and requires a notation
mapping for defining the modelling
at M1
stm OwnerProtocolBehaviour
Initial
ADMISSION
READINESS
NEGOTIATING
Waiting
«Do»
+ do / waitEvent(receiveMessage(Offer))
NotAgreed
EvaluatingOffer
«Ingress»
+ entry / evaluateMessage(Offer)
«Do»
+ entry / createMessage(OfferResponse)
«Egress»
+ exit / sendMessage(OfferResponse)
Acceptance
Agreed
CreatingRFP
«Do»
+ do / createMessage(RequestForProposal)
WaitingforAdmissionRequest
«Do»
+ do / waitEvent(receiveMessage(AdmissionRequest))
EvaluatingParticipant
«Do»
+ do / createMessage(AdmissionResponse)[sendMessage(AdmissionResponse)]
[OfferResponse.value =
Accept]
receiveMessage(Offer)
/sendMessage(RequestForProposal)
[receiveMessage(AdmissionRequest)]
20. 20
www.soluta.net gmontanari@soluta.net
Action language issue
Negotiations need imperative language for decision block
“If time left <5 minutes and new offers arrive, then extend negotiation
deadline by other 10 minutes”
“Final price is equal to the value of the second offer arrived “
Behavioural logic (xUML) in UML/OMG is a recent addiction
Action language or OCL
We opt to go with Java Script which was added to the XMI streamed-line
model
Not formal but practical for the need of the project
Straight to the runtime where the Java code can be executed
23. 23
www.soluta.net gmontanari@soluta.net
How it was created and used
.eap file
Generates
NMM XMI
.ecore file
Negotiation
Model Editor
NM
XMI
NM XMI
with values
Ecore->JPDL
transformation
JPDL
transformation
Sparx Systems
EA Custom Code
Setup
Negotiation
Engine
Bean Shell
25. 25
www.soluta.net gmontanari@soluta.net
The Setup phase: adding data
The Setup create a negotiation
instance adding data to the model
ONE SetUp
KB
Negotiation
Model
XMI
Input GUI
ZK AJAX
Automatic
Generation
Negotiation
Instance
XMI
Read
Store
27. 27
www.soluta.net gmontanari@soluta.net
Conclusions
MDA is supported by Open Source Communities
Standards are sufficiently mature for supporting a challenging project like ONE
The business analysts feel confident when modelling using DSL
The definition of a DSL is still a hard task to accomplish
Still a need to use a plethora of tools to “execute” DSL
Next step:using the natural language to create models (SBVR)