/
jbpm4.cfg.xml
251 lines (205 loc) · 9.88 KB
/
jbpm4.cfg.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration spring="enabled" xmlns="http://jbpm.org/xsd/cfg">
<!--
readings to understand whats going on here:
https://www.hibernate.org/42.html
http://seamframework.org/Documentation/SeamSpringAndJBPMIntegrationHowTo
http://www.inze.be/andries/2009/05/16/demo-on-spring-integration-with-jbpm4/
-->
<!-- this is retrieved from the jbpm jars and defines the basic jpdl stuff-->
<import resource="jbpm.jpdl.cfg.xml" />
<!--
this is the outermost context that seems to be open all the time
when jBPM is running, other contexts are
transaction, execution, task, job
-->
<process-engine-context>
<!-- we avoid autowiring triggered spring context lookups by using the
classname instead of the tag from the autowiring, the error lookslike this:
WARN org.jbpm.pvm.internal.env.SpringContext - Multiple Spring beans found for type interface java.util.Map returning the first one found
org.jbpm.pvm.internal.repository.RepositorySessionImpl
trying to resolve field name repositoryCache
org.jbpm.pvm.internal.repository.RepositoryCacheImpl
tryto resolve class deploymentClassLoaders
-->
<!-- used for creating entries in the groovy scripts called by the workflow engine
on transition events... -->
<object name="entryFactory" class="net.wohlfart.jbpm4.entities.MessageEntryFactory" />
<!--
configuring the repository service by classname, this is usually
org.jbpm.pvm.internal.repository.RepositoryServiceImpl and looks like this:
<repository-service />
however we have added some methods
-->
<object class="net.wohlfart.jbpm4.CustomRepositoryService">
<field name="commandService"><ref object="txRequiredCommandService" /></field>
</object>
<!--
<job-executor threads="5" auto-start="true" />
-->
<!--
configuring the repository cache by classname to get around some
auto-wiring problems, see:
http://community.jboss.org/message/532443#532443
<repository-cache /> -->
<object class="org.jbpm.pvm.internal.repository.RepositoryCacheImpl" />
<!-- custom mail registry is a dummy just to make the parser happy -->
<object class="net.wohlfart.jbpm4.mail.CustomMailRegistry" />
<!-- custom mail session, called whenever a mail needs to be send -->
<object class="net.wohlfart.jbpm4.mail.CustomMailSession" >
<!-- a spring configured mail sender used in the mail session -->
<field name="springMailSender"><ref object="springMailSender" /></field>
</object>
<!-- custom calendar, this is just a dummy for the parser, no need for it yet -->
<object class="net.wohlfart.jbpm4.cal.CustomBusinessCalendar" />
<execution-service />
<history-service />
<management-service />
<!--
we use the standard identity service which is a wrapper for
our custom identity session which is configured in the transaction
context and will be picked up from the service when needed
<identity-service /> -->
<object name="customIdentityService"
class="net.wohlfart.jbpm4.CustomIdentityService">
<field name="commandService"><ref object="txRequiredCommandService" /></field>
</object>
<!--
use: net.wohlfart.jbpm4.CustomIdentityService.findAuthenticatedUser()
however we added one static method in order to get the user from the current session:
the objects are buffered, so this doesn't work here:
<object name="authenticatedUser"
class="net.wohlfart.jbpm4.CustomIdentityService"
method="findAuthenticatedUser" /> -->
<task-service />
<!-- this is a id generator used in the standard jbpm4 config, however the mapping files
are patched in order to let hibernate generate ids by using the enhanced table
id generators like for the domain objects this way we have consistent ids for all tables
<object class="org.jbpm.pvm.internal.id.DatabaseDbidGenerator">
<field name="commandService"><ref object="newTxRequiredCommandService" /></field>
<invoke method="initialize" />
</object> -->
<!-- this class generates the unique String ids for the ID_ fields
note: DBID_ Field are generated in Hibernate ID_ fields are generated by this class -->
<object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager" />
<object class="org.jbpm.pvm.internal.el.JbpmElFactoryImpl" />
<types resource="jbpm4.variable.types.xml" />
<!-- resolves user to email addresses, not needed
<address-resolver /> -->
<!-- the job executor is a spring beans since we need the transaction from spring
command-service="txRequiredCommandService"
command-service="newTxRequiredCommandService"
<job-executor threads="4"
idle="1500000"
idle-max="6000000"
lock-millis="360000000"
auto-start="true"
/>
-->
<command-service name="newTxRequiredCommandService"> <!--
use no retry for testing
<retry-interceptor /> -->
<environment-interceptor policy="requiresNew" />
<spring-transaction-interceptor transaction-manager="localTransactionManager" current="false" policy="requiresNew" />
</command-service>
<command-service name="txRequiredCommandService"> <!--
use no retry for testing
<retry-interceptor /> -->
<environment-interceptor />
<spring-transaction-interceptor transaction-manager="localTransactionManager" current="true" />
</command-service>
<command-service name="jobExecutionCommandService"> <!--
<command-service name="jobExecutionCommandService" async="true" propagate-auth="true" >
use no retry for testing
<retry-interceptor /> -->
<environment-interceptor />
<spring-transaction-interceptor transaction-manager="localTransactionManager" current="true" />
</command-service>
<!--
see: http://community.jboss.org/thread/149958?tstart=0
default search order for variables is: execution,transaction,process-engine,spring
note there are multiple read context but only one write context
see:
http://www.inze.be/andries/2009/06/28/documentation-spring-jbpm-integration/
for the read-contexts configuration
org.jbpm.pvm.internal.wire.binding.ScriptManagerBinding
disabled before release of 4.0
read-contexts="conversation, execution, environment, process-engine, spring"
write-context="execution"
read-contexts="conversation, execution, environment, process-engine, spring"
<script-manager default-expression-language="juel"
default-script-language="groovy">
<script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
<script-language name="bsh" factory="org.jbpm.pvm.internal.script.BshScriptEngineFactory" />
<script-language name="groovy" factory="org.jbpm.pvm.internal.script.GroovyScriptEngineFactory" />
</script-manager>
-->
<!-- we seriously customized the script manager implementation -->
<object class='net.wohlfart.jbpm4.CustomScriptManager'>
<field name='defaultExpressionLanguage'><string value='juel' /></field>
<field name='defaultScriptLanguage'><string value='groovy' /></field>
</object>
</process-engine-context>
<!--
<transaction-context>
<repository-session />
<! - - cusom identity component, this is just a dummy class so far
<object class="net.wohlfart.authentication.JbpmIdentitySessionImpl" /> - - >
<transaction type="standard" />
<db-session />
<message-session />
<timer-session />
<history-session />
< ! - - current="true" needs to set explicitly that we
don't want jbpm to create sessions, we use transaction aware sessions
so this should work without current="true"
tx="true"
- - >
<hibernate-session factory="jbpm4SessionFactory"
current="false"
/>
</transaction-context>
-->
<!--
this context is pushed onto the current context in ProcessEngineImpl
and popped afterwards -->
<transaction-context>
<transaction type="spring"/>
<!--
causes a map lookup in the spring context:
<repository-session />
<repository-session factory="sessionFactory" /> <- working
<repository-session factory="hibernateSessionFactory" /> -->
<repository-session factory="sessionFactory" />
<db-session />
<query-session />
<message-session />
<timer-session />
<history-sessions>
<object class="org.jbpm.pvm.internal.history.HistorySessionImpl" />
</history-sessions>
<!-- we can not configure mail-session here again since
we have CustomMailSession configured above
<mail-session /> -->
<!-- the current session config
<hibernate-session factory="sessionFactory" current="true" close="false" tx="true" /> <- working
<hibernate-session factory="hibernateSessionFactory" current="false" close="true" tx="true" />
-->
<!-- -->
<hibernate-session factory="sessionFactory" current="true" close="false" tx="true" />
<!-- not yet used
<identity-session /> -->
<!-- custom replacement for the identity session, used by the also custom identity service: -->
<object class="net.wohlfart.authentication.JbpmIdentitySessionImpl" /> <!--
<field name="session" ><ref type="Session.class"></ref></field>
</object> -->
<!-- the authenticated user is transaction scoped -->
<object name="authenticatedUser"
class="net.wohlfart.jbpm4.CustomIdentityService"
method="findAuthenticatedUser" />
</transaction-context>
<deployer-manager>
<transaction />
<jpdl-deployer />
</deployer-manager>
</jbpm-configuration>