0
Implement your business
logic
Oct 10th, 2013 Benjamin Jalon & Frédéric Vadon
Implement Business Logic ?

= Make sure your system enforce
your business constraints

2
Example of business Logic
- My documents should have a topic field
- Documents should be moved to another
department when t...
Technical translation
It is usually means the system (Nuxeo) will do things for you,
like:
- Updating one or more metadata...
How can this be done ?

Automation

5
Automation - an operation
Category

Parameters

Description

o
Input
/outpout

o
6
Automation - a chain
Document on
which we will
work

Update of a
metadata

Log in Nuxeo
Audit
7
How to use an chain?
•

Bind it to a button

•

Bind it to an event handler

•

To Workflow

•

Call it as a webservice

8
Let’s try !
1. Create a button that updates the
description property with “Hello world”
value
2. Use the latter chain so t...
I want more !

Use MVEL
@{ }

10
Referencing a metadata

@{ Document[“dc:title] }

11
Let’s try !

1. On the previous button that adds “Hello
world”, make sure it logs in the audit an
entry with a comment tha...
I want more !

Use Automation Context

13
A context for the whole chain
•

Context is useful to “store” objects/
information during the time of the
execution of the...
Tools to play with the context

•

A “map of objects” called “Context” for
accessing the context from MVEL:
@{Context[“my_...
Tools to play with the context

Very useful !

16
Tools to play with the context

Very useful !

17
Let’s try !
1. When creating a File document, make
sure you get automatically the same
“coverage” than the one that is on ...
Next

Automation is so cool, eh,
why do I need workflow ?

19
Why Using Workflows

•

Bring you time based automation

•

Offers interaction with users, asking
them their input (forms, b...
What Is a Workflow in Nuxeo

•

A set of nodes linked on a graph

•

References to automation chains to
define what is autom...
Starting with workflows

Let’s go iterative

22
Create users on your instance

23
Create Users on Your
Instance

•

john/john , group: members

•

jack/jack , group: members

•

group: nxworld

24
Assign a task to john

•

Drop a task node

•

Make sure there is one or two buttons

•

Link the transitions

•

Deploy a...
More assignments cases

•

assign to a group (group:nxworld)

•

assign to the workflow initiator
(“workflowInitiator”)

26
Play with the security

•

Make sure John can read the document
when he is assigned the task.

27
Plug an automation chain on
your workflow
•

Write a new automation chain

•

Plut it to the workflow, for example for
updat...
13
ld

or
xW
#N

Thank you

!
Upcoming SlideShare
Loading in...5
×

[Nuxeo World 2013] Workshop - Implement your Business Logic

305

Published on

- Create chains of operations to model your business logic
- Design workflows to implement your processes, with fork/merge points, escalation support, due date management, dynamic sub-workflows, etc.
- Configure user actions (actionable buttons) and event reactors triggering chains of operations
- Configure email notifications

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
305
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "[Nuxeo World 2013] Workshop - Implement your Business Logic"

  1. 1. Implement your business logic Oct 10th, 2013 Benjamin Jalon & Frédéric Vadon
  2. 2. Implement Business Logic ? = Make sure your system enforce your business constraints 2
  3. 3. Example of business Logic - My documents should have a topic field - Documents should be moved to another department when they are validated - They should become obsolete after one year - Only the group “validators” can see it while the document is not published .... .... 3
  4. 4. Technical translation It is usually means the system (Nuxeo) will do things for you, like: - Updating one or more metadata of a document - Creating a document automatically - Changing the lifecycle of a document (done this morning) - Doing a conversion of a document - Setting an ACL automatically on the document - Assigning tasks to users on the resources 4
  5. 5. How can this be done ? Automation 5
  6. 6. Automation - an operation Category Parameters Description o Input /outpout o 6
  7. 7. Automation - a chain Document on which we will work Update of a metadata Log in Nuxeo Audit 7
  8. 8. How to use an chain? • Bind it to a button • Bind it to an event handler • To Workflow • Call it as a webservice 8
  9. 9. Let’s try ! 1. Create a button that updates the description property with “Hello world” value 2. Use the latter chain so that each time you create a document, the description is equal to “Hello World”. 3. Create a button that moves the current document just under /default-domain/ workspaces 9
  10. 10. I want more ! Use MVEL @{ } 10
  11. 11. Referencing a metadata @{ Document[“dc:title] } 11
  12. 12. Let’s try ! 1. On the previous button that adds “Hello world”, make sure it logs in the audit an entry with a comment that prints the value of the dc:title, dc:description, dc:creator 12
  13. 13. I want more ! Use Automation Context 13
  14. 14. A context for the whole chain • Context is useful to “store” objects/ information during the time of the execution of the chain • Store a value at 2nd step of your chain, use it at the 5th step • Store document, list of documents, metadata value, any value ! 14
  15. 15. Tools to play with the context • A “map of objects” called “Context” for accessing the context from MVEL: @{Context[“my_variable”} • Some operations in the category “Execution context” 15
  16. 16. Tools to play with the context Very useful ! 16
  17. 17. Tools to play with the context Very useful ! 17
  18. 18. Let’s try ! 1. When creating a File document, make sure you get automatically the same “coverage” than the one that is on the workspace. 2. Add a button that creates beside a given file a note called “Review of document XXX” where XXX is the title of the first document 18
  19. 19. Next Automation is so cool, eh, why do I need workflow ? 19
  20. 20. Why Using Workflows • Bring you time based automation • Offers interaction with users, asking them their input (forms, buttons) • Produces a very maintainable business logic implementation! 20
  21. 21. What Is a Workflow in Nuxeo • A set of nodes linked on a graph • References to automation chains to define what is automated at each nodes • Definition of forms and buttons to defined what a user should contribute at a given node 21
  22. 22. Starting with workflows Let’s go iterative 22
  23. 23. Create users on your instance 23
  24. 24. Create Users on Your Instance • john/john , group: members • jack/jack , group: members • group: nxworld 24
  25. 25. Assign a task to john • Drop a task node • Make sure there is one or two buttons • Link the transitions • Deploy and test 25
  26. 26. More assignments cases • assign to a group (group:nxworld) • assign to the workflow initiator (“workflowInitiator”) 26
  27. 27. Play with the security • Make sure John can read the document when he is assigned the task. 27
  28. 28. Plug an automation chain on your workflow • Write a new automation chain • Plut it to the workflow, for example for updating the title of the document, right at the end of the workflow. 28
  29. 29. 13 ld or xW #N Thank you !
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×