From zero to_j_bpm_hero_tomek_bujok
-
Upload
tomekbujok -
Category
Technology
-
view
871 -
download
0
description
Transcript of From zero to_j_bpm_hero_tomek_bujok
2010
From zero to jBPM hero!
Tomasz Bujok
2010
Agenda
• Trochę teorii - idee fix BPM• jBPM – „let’s make your work flow”• Frontendowe aplikacje typu workflow• Solidne demo!• Wzorce projektowe / dobre praktyki• Wersjonowanie procesów
2010
Cel prezentacji
vs.
2010
Proces biznesowy
• Seria powiązanych ze sobą działań lub zadań, które rozwiązują określony problem lub prowadzą do osiągnięcia określonego efektu.
• Zaplanowany przebieg działań mający na celu uzyskiwanie określonych rezultatów.
2010
Business Process Management
• Dziedzina zarządzania• Niezwiązana z IT• Wprowadza poziom abstrakcji• Cykl życia składa się z 5 faz
– Zaprojektuj - BPML– Zaimplementuj – BPEL– Uruchom – BPMS– Zbadaj wydajność - BPMS– Zoptymalizuj - BPR
2010
Business Process Modeling Lang.
• Business Process Modeling Notation (BPMN)
• Cognition enhanced Natural language Information Analysis Method (CogNIAM)
• Extended Business Modeling Language (xBML)
• Event-driven process chain (EPC)• ICAM DEFinition (IDEF0)• Unified Modeling Language (UML)
2010
Business Process Execution Lang.
• Event-driven Process Chains (EPC) by ARIS,
• Business Process Execution Language (BPEL),
• Web Services Choreography Description Language (WS-CDL),
• XML Process Definition Lang. (XPDL),• Java Process Definition Lang. (JPDL) by
jBPM
<task name="Accept offer"> <transition to="charge customer"/> <transition name="timeout" to="cancel"> <timer duedate="1 day"/> </transition> </task>
2010
BPMS oraz BPR
2010
BPMS – do wszystkiego czy do…?
2010
„Standalone BPM is dead”
• High cost of setup. This implies getting the software up and running and also get all people up to speed with the technology.
• High cost of integrating the BPM system with the outside world. Integration results in a significant threshold.
http://processdevelopments.blogspot.com/2010/05/standalone-bpm-is-dead.html
2010
Magic quadrant for BPMS
2010
jBPM4 Execution Mode
Processes
Executions
History
JVM(1)
Persistent Dynamic
2010
jBPM4 Architecture
PVM InternalsPVM Interface
Pro
cess
Engin
e
Process Service
Execution Service
Management Service
TaskService
Command Service
Interceptor
Interceptor
Commands
Event Listener API
Serv
ices
Clie
nt
Diagram downloaded from: http://www.slideshare.net/camunda/jboss-jbpm-4 (later modified)
2010
Human Task<process name="TaskProcess">
<start><transition to="AcceptOffer" name="Start"/>
</start>
<task name="AcceptOffer"><transition to="OfferAccepted"
name="AcceptOffer" /> </task>
<end name="OfferAccepted"/></process>
2010
Membership / Assignment<process name="MembershipProcess">
... <swimlane candidate-groups="ROLE_ANALITYK" name="LOAN">
<task name="Task1" candidate-groups="ROLE_DORADCA"><transition ... />
</task>
<task name="Task2" swimlane="LOAN"><transition ... />
</task>
<task name="Task3"><assignment-handler class="pl.javarsovia.Assigner"><transition ... />
</task> ...</process>
2010
State<process name="StateProcess">
<start> <transition to="wait"/> </start>
<state name="wait"> <transition to="end"/>
</state> <end name="end"/>
</process>
2010
Decision<process name="DecisionProcess"> ... <decision name="decide">
<handler expr="pl.javarsovia.Decider"/> <transition to="success"/> <transition to="failure"/>
</decision> <decision name="evaluate document" expr="#{content}"> <transition name="OK" to="success" /> <transition name="NOK" to="failure" /> </decision> ...</process>
2010
Java<process name="JavaProcess"> ... <java name="service" method="notify"
class="pl.javarsovia.Notificator">
<field name="retryCount" > <int value="100" />
</field >
<arg> <string value="Hello Javarsovia!"/>
</arg>
<transition to="end"/> </java> ...</process>
2010
Fork-Join<process name="ForkJoinProcess"> ... <fork name="fork">
<transition to="notify"/> <transition to="execute"/>
</fork>
<task name="notify"> ... </task> <task name="execute"> ... </task>
<join name="join"> <transition to="end"/></join>
...</process>
2010
Event-listener<process name="EventListenerProcess">
...<task name="AcceptOffer"> <on event="start|end">
<event-listener class="pl.javarsovia.Listener">
</event-listener> </on> <transition to="notify"> <event-listener
class="pl.javarsovia.Listener"> </event-listener> </transition>
</task>...
</process>
2010
Timer<task name="AcceptOffer">
<transition to="Accept" /><transition to="Escalate" >
<timer duedate="10 minutes" ></transition>
</task>
<state name="GuardedWait"><transition to="Accept" /><on event="timeout"> <timer duedate="2 business days" > <event-listener class="pl.javarsovia.Listener"/>
</on></state >
2010
jBPM4 API
Process engine
RepositoryService
Managing deployments
Deployment createDeployment()deployment.addResourceFromClasspath("")
ProcessDefinitionQuery createProcessDefinitionQuery();
Diagram downloaded from: http://www.slideshare.net/jorambarrez/presentation-jbpm-community-day-2009-first-steps-with-jbpm4
2010
jBPM4 API
Process engine
RepositoryService
ExecutionService
Managing runtime executions
startProcessInstanceById(pd_id)
signalExecutionByXXX
Get/setVariable(s)
Diagram downloaded from: http://www.slideshare.net/jorambarrez/presentation-jbpm-community-day-2009-first-steps-with-jbpm4
2010
jBPM4 API
Process engine
RepositoryService
ExecutionService
TaskService
Managing tasks
takeTask(actor)
completeTask(outcom)
cancelTask(task)
AssignTask(actor)
findTaskXXX
Diagram downloaded from: http://www.slideshare.net/jorambarrez/presentation-jbpm-community-day-2009-first-steps-with-jbpm4
2010
jBPM4 API
Process engine
RepositoryService
ExecutionService
TaskService
HistoryService
Managing past runtime data
HistoryActivityInstanceQuery query=historyService.createXXXQuery() .activityName("Wait") .executionId(“123");query.execute
Diagram downloaded from: http://www.slideshare.net/jorambarrez/presentation-jbpm-community-day-2009-first-steps-with-jbpm4
2010
jBPM4 API
Process engine
RepositoryService
ExecutionService
TaskService
HistoryService
ManagementService
Process engine maintenance
executeJob(long jobDbid)
Diagram downloaded from: http://www.slideshare.net/jorambarrez/presentation-jbpm-community-day-2009-first-steps-with-jbpm4
2010
jBPM4 API
Process engine
RepositoryService
ExecutionService
TaskService
HistoryService
ManagementService
Aplikacja
Komunikacja tylko przez interfejsy
Diagram downloaded from: http://www.slideshare.net/jorambarrez/presentation-jbpm-community-day-2009-first-steps-with-jbpm4
2010
Transakcyjność
• Continue: – sync– async– exclusive
Transaction 1 Transaction 2
JobExecutor
2010
Demo
Picture downloaded from: http://www.slideshare.net/camunda/jboss-jbpm-4
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow use-case
2010
Workflow z BPM
• Występują human-tasks• Występuje podział na role procesowe• Dekompozycja logiki jest możliwa• Potrzebujemy maszyny stanów• Równoległa praca na
sprawie/procesie• Wymagane wersjonowanie „na
zakładkę”
2010
Co wybrać?
• Java– Trwa dłużej– Proces niewidoczny– Wait state’y– Eskalacje / timeout’y
• BPM– Same plusy
2010
Demo
Picture downloaded from: http://www.slideshare.net/camunda/jboss-jbpm-4
2010
Korzyści
• „Czysta” architektura • Eksternalizacja logiki biznesowej• Podział ról• Łatwość wprowadzania zmian• Prostota wyrażania konstrukcji• NIH – „plumbing code”
2010
Patterns and Practices
Picture downloaded from: http://www.slideshare.net/jorambarrez/presentation-jbpm-community-day-2009-first-steps-with-jbpm4
2010
1. Design procesów• Wizard?
• Entry-point?
2010
2. Ziarnistość procesów
ACTION
ACTION
ACTION
COMPOSITEACTION
service.invokeA()
service.invokeB()
service.invokeC()
service.invokeABC()
2010
3. Event-driven architecture!!!
public boolean isValidationRequired(String transition) {if ( transition.equalsIgnoreCase(STEP_TO_INITIALCREDITABILITY)
|| transition.equalsIgnoreCase(STEP_TO_ASSESSMENT) || transition.equalsIgnoreCase(STEP_ACCEPTED_CHANGED_DATA) || transition.equalsIgnoreCase(STEP_TO_REGISTER_APPLICATION) || transition.equalsIgnoreCase(STEP_TO_AGREEMENT) || transition.equalsIgnoreCase(STEP_RUN_CREDIT) ||transition.equals(STEP_VERIFY_DOCS_BY_STARTUP)
) {return true;
} else {return false;
}
2010
4. Lokalizacja logiki (1/3)
TASK TASK
EVENT
EVENT
2010
TASK
4. Lokalizacja logiki (2/3)
EVENT
TASK
EVENT
TASK
2010
4. Lokalizacja logiki (3/3)
TASK TASK
EVENT
EVENT
TASK TASK
2010
5. Wersjonowanie (1/3)
Interfejs użytkownikaInterfejs użytkownika
Warstwa aplikacyjnaWarstwa aplikacyjna
Świat zewnętrzny (ESB)Świat zewnętrzny (ESB)
Procesy biznesoweProcesy biznesowe
ArtyfaktArtyfakt
2010
5. Wersjonowanie (2/3)<process name="DecisionProcess"> ... <decision name="decide">
<handler class="pl.javarsovia.Decider"><field name="argument"> <object class="pl.javarsovia.DecisionArgument"> ... </object></field>
</handler> </decision> ...</process>
2010
5. Wersjonowanie (3/3)<process name="DecisionProcess"> ... <decision name="decide">
<handler expr="${decider}"><field name="argument"> <object expr ="${decisionArgument}"> ... </object></field>
</handler> </decision> ...</process>
2010
6. Flow context - wersjonowanie
PROCESS FLOW CONTEXT
class FlowContext {String username;Integer nodeCount;Date activityDate;
}
<flowContext> <username></username> <nodeCount></nodeCount> <activityDate></activityDate></flowContext>
2010
7. Walidacje
TASK1
TASK3TASK2
2010
7. Walidacje
TASK1
TASK3TASK2
V1 1.W trakcie trwaniazadania – np. zapis.
2010
7. Walidacje
TASK1
TASK3TASK2
V1
V22. W trakcie wyjścia z zadania
2010
7. Walidacje
TASK1
TASK3TASK2
V1
V2
V3 V4
3 i 4. W trakcie próbyprzejście wybranąścieżką
2010
jBPM - Status projektu
Sep Oct Dec Jan Feb Mar Apr May Jun Jul Aug Sep
20102009Nov
4.1 4.2 4.3 4.4 4.5
jBPM 5
BPMN 2.0jPDL
2010
jBPM - Status projektu
Sep Oct Dec Jan Feb Mar Apr May Jun Jul Aug Sep
20102009Nov
4.1 4.2 4.3 4.4 4.5
jBPM 5
BPMN 2.0jPDL
2010
Dziękuję
Picture downloaded from: http://www.slideshare.net/camunda/jboss-jbpm-4
2010
Q&A