7. Activiti & Java
• Out-of-the-box
– Control flow
– Functional
activity types
– Everything you
exect in a
typical
BPM System
• But…
– Not limited to out of the box
7
8. Activiti is an Embeddable Process Engine
Any .jar
Java
Environment
Oracle || MySQL || PostgreSQL || Any DB…
Processes Executions History
8
Your Domain Tables
9. Activiti Embeds In Your App
• Embeds in
• Your database
• Your transaction
• Your domain model
• Your tests
• Your Spring configuration
Tomcat Activiti Your
JDK 5 App
JBoss Spring Oracle, MySQL, PostgreSQL
…
9
26. Real-life demo
• Use case: banks shouldn’t lend money to just anybody
• Thorough analysis is needed
• All steps needs to be recorded in official documents
• Decisions are done based on Excel decision tables
26
31. The power of Java
public class CreateLoanApplicationDocument implements JavaDelegation {
public void execute(DelegateExecution execution) {
Session session = CmisUtil.createCmisSession("admin", "admin", Constants.ALFRESCO_URL);
Folder folder = CmisUtil.getFolder(session, Constants.LOAN_APPLICATION_STORAGE_FOLDER
Document document = createWordDocument(session, folder, execution);
storeDocumentReferencesAsProcessVariables(execution, folder, document);
session.save();
}
31
32. The cool stuff
• That didn’t make it in the demo
• But is just too cool not to show you
• Unit test support
• Query API
• Spring integration
• Method expressions
• JPA integration
32
33. Unit testing your processes
• With Activiti, business processes
• Live and breath along your regular app code
• Should be tested just the same!
• Typical BPM vendor & testing
• Activiti supports Junit 3 & 4 and offers lots of
convience while testing
33
34. Query API
• No need to learn the intern data model
• Powerful and uniform query API
• Deployments and process definitions
repositoryService.createProcessDefinitionQuery.keyLike(“%mortgage%”).latest();
• Process instances and executions
runtimeService.createProcessInstanceQuery
.processDefinitionKey(“mortgage-process)”.orderByProcessInstanceId().desc();
• History
historyService.createHistoricActivityQuery().processDefinitionId(procDefId)
.activityType(“userTask”).orderByDuration().asc();
• Variables
runtimeService.createProcessInstanceQuery()
.variableValueGreaterThan(“amount”, 50000);
• Tasks, jobs, users, groups, historic activities/process
instances/variables, …
35. Spring integration
• ProcessEngine as a Spring bean
• Delegate to Spring beans
<bean id=“printer” …
35
36. Method expressions & JPA
Decision based on
JPA entity property
Spring bean
Process variables
36
37. The Activiti Experience
• Satisfy your Activiti itch
• One-stop-shop download
• http://activiti.org
• Demo: “The Activiti Experience”
• Do you have an excuse for
not trying out Activiti tonight?
37
38. Did you like what you saw?
• We keep making Activiti better, every day.
• Help us today and tweet your enthousiasm!
• @johnpowell996 I saw #activiti on #devoxx and I like it!
owell
John P esco
Alfr
CEO
38
Hinweis der Redaktion
We came from JBoss jBPM Joined Alfresco to build new process engine