jbpm4 deployer
TRANSCRIPT
jBPM4 container integration: Deployer
Heiko Braun <[email protected]>09.03.2009
Overview
• Process deployment specifics
• Concepts and gotchas with deployment/undeployment
• Status and next steps
AS deployments
• Create a *.par archive and copy it to server/<config>/deploy
• Can be done while AS running or when it’s shutdown
• Covered by the AS deployer API
Process deployment: BPM specifics
• In BPM we expect long running processes
• i.e. exists across AS reboots
• Processes are versioned:
• Deployment can lead to a new versionor “replace” a prior one (aka patching)
• Process model is actually a database model:
• Redeployment is not idempotent [1]
[1] “Acting as if used only once, even if used multiple times. “
Deployment• Two approaches: Version or
timestamp identification
• Version: Explicit as part of the process definition (*.jpdl.xml)
• Timestamp: Implicit, refers to the actual deployment artifact (filesystem)
• Applies to the same deployment artifact (filename)
• Derived policy identifies processes that will be stored in DB
Deployment scenarios
• Patching a process (i.e. replacing a class, bugfix, etc):- same artifact with same version
• Providing a new process (i.e. different pdl):- same artifact different version, or no version at all
• Otherwise: New artifact, new version
Undeployment
• Single approach: Does the deployment artifact exist?
• Usally undeployment happens when removing files from server/<config>/deploy
• Exception: On server shutdown, all deployer get undeployment callbacks
• Only if the deployment artifact is deleted the process will be removed
Undeployment scenarios
• Server shutdown- retain process
• Artifact removed w. server running- delete process
• Artifact removed with server stopped- Not realized by process engine ?!
Process lifecycle and classloader
• Server boot - Associate classloader, flag process “ready”
• Server shutdown- Remove classloader, flag process “shutdown”
• Gotcha: Artifact removed while server is shutdown
• upon boot only processes w. artifacts will be flagged “ready”
• leaves non-usable (“shutdown”) processes that need to be removed manually
Status
• Resides in ‘modules/integration’
• Implemented for AS 5
• No JNDI binding yet
• No classloader association
• Works as proof of concept
Next steps
• Port to AS 4.2.x
• Implement JNDI bindings
• Relationship to ‘enterprise’ module
• Extended in container test coverage
Q&A
Appendix: Implemention on AS 5• Deployment example
16:22:41,522 INFO [JBPMDeployer] Deploy JBPMDeploymentMetaData {unit=vfszip:/Users/hbraun/dev/prj/jboss/tags/JBoss_5_0_0_GA/build/output/jboss-5.0.0.GA/server/default/deploy/Simple-Alpha2.jar/Simple_noversion.jpdl.xml, jpdl=vfszip:/Users/hbraun/dev/prj/jboss/tags/JBoss_5_0_0_GA/build/output/jboss-5.0.0.GA/server/default/deploy/Simple-Alpha2.jar/Simple_noversion.jpdl.xml, cl=BaseClassLoader@bc4d42{vfszip:/Users/hbraun/dev/prj/jboss/tags/JBoss_5_0_0_GA/build/output/jboss-5.0.0.GA/server/default/deploy/Simple-Alpha2.jar}}16:22:41,571 INFO [VersionTimestampPolicy] Timestamp driven policy evaluation: process 'Simple_noversion', timestamp 123661215700016:22:41,615 INFO [JBPMDeployer] Deploy JBPMDeploymentMetaData {unit=vfszip:/Users/hbraun/dev/prj/jboss/tags/JBoss_5_0_0_GA/build/output/jboss-5.0.0.GA/server/default/deploy/Simple-Alpha2.jar/Simple_version.jpdl.xml, jpdl=vfszip:/Users/hbraun/dev/prj/jboss/tags/JBoss_5_0_0_GA/build/output/jboss-5.0.0.GA/server/default/deploy/Simple-Alpha2.jar/Simple_version.jpdl.xml, cl=BaseClassLoader@bc4d42{vfszip:/Users/hbraun/dev/prj/jboss/tags/JBoss_5_0_0_GA/build/output/jboss-5.0.0.GA/server/default/deploy/Simple-Alpha2.jar}}16:22:41,641 INFO [VersionTimestampPolicy] Version driven policy evaluation: process 'Simple_withversion', version 3
Appendix: Implemention on AS 5• Embracing EE5:
class myEJB { [...] try { InitialContext ctx = new InitialContext(); this.processEngine = (ProcessEngine)ctx.lookup("java:/jbpm4"); } catch (Exception e) { throw new RuntimeException("Failed to lookup process engine"); }
}
2009-03-09 15:26:22,737 INFO [org.jbpm.integration.jboss5.JBPMServiceImpl] (main) ProcessEngine bound to: java:/jbpm4