jbpm4 deployer

14

Click here to load reader

Upload: hbraun

Post on 19-May-2015

1.547 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Jbpm4 Deployer

jBPM4 container integration: Deployer

Heiko Braun <[email protected]>09.03.2009

Page 2: Jbpm4 Deployer

Overview

• Process deployment specifics

• Concepts and gotchas with deployment/undeployment

• Status and next steps

Page 3: Jbpm4 Deployer

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

Page 4: Jbpm4 Deployer

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. “

Page 5: Jbpm4 Deployer

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

Page 6: Jbpm4 Deployer

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

Page 7: Jbpm4 Deployer

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

Page 8: Jbpm4 Deployer

Undeployment scenarios

• Server shutdown- retain process

• Artifact removed w. server running- delete process

• Artifact removed with server stopped- Not realized by process engine ?!

Page 9: Jbpm4 Deployer

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

Page 10: Jbpm4 Deployer

Status

• Resides in ‘modules/integration’

• Implemented for AS 5

• No JNDI binding yet

• No classloader association

• Works as proof of concept

Page 11: Jbpm4 Deployer

Next steps

• Port to AS 4.2.x

• Implement JNDI bindings

• Relationship to ‘enterprise’ module

• Extended in container test coverage

Page 12: Jbpm4 Deployer

Q&A

Page 13: Jbpm4 Deployer

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

Page 14: Jbpm4 Deployer

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