-
1. Re: JBPM 4.0 HistoryEvent, HistorySession
tcr Sep 21, 2009 7:15 AM (in response to tcr)Addition:
I wasn't able to find a binding for HistorySessionChain. I created one (see below).
Maybe some hints for all who want to add a custom historySession....
Steps:
- Create your custom history Session (implement org.jbpm.pvm.internal.history.HistorySession)
- Create the binding class for the custom history session (you can copy the binding from historySession and adjust tag and class)
- Create the binding class for the historySessionChain (see below)
- Add both bindings to jbpm.wire.bindings.xml
- Change your configuration by adding the chain-tag including the actual history sessions.
Last problem I have:
Can anyone see an option to get the of the execution memeber of the history-events in the custom event session without changing the code?
Regards
Torsten
CustomHistorySession.javapackage com.test; public class CustomHistorySession implements HistorySession { public void process(HistoryEvent historyEvent) { // Do your custom work here } }
CustomHistorySessionBinding.javapackage com.test; public class CustomHistorySessionBinding extends WireDescriptorBinding { public CustomHistorySessionBinding() { super("custom-history-session"); } public Object parse(Element element, Parse parse, Parser parser) { return new ObjectDescriptor(CustomHistorySession.class); } }
HistorySessionChainBinding.java (copy and modify from deployer-manager)package com.test; public class HistorySessionChainBinding extends WireDescriptorBinding { private static final String HISTORY_SESSION_CHAIN_TAG = "history-session-chain"; public HistorySessionChainBinding() { super(HISTORY_SESSION_CHAIN_TAG); } public Object parse(Element element, Parse parse, Parser parser) { ObjectDescriptor objectDescriptor = new ObjectDescriptor(HistorySessionChain.class); ListBinding listBinding = new ListBinding(); ListDescriptor listDescriptor = (ListDescriptor) listBinding.parse(element, parse, parser); objectDescriptor.addInjection("delegates", listDescriptor); return objectDescriptor; } }
jbpm.wire.bindings.xml<binding class="org.jbpm.pvm.internal.wire.binding.HistorySessionBinding" /> <binding class="com.test.HistorySessionChainBinding" /> <binding class="com.test.CustomHistorySessionBinding" />
jbpm.cfg.xml<transaction-context> [...] <history-session-chain > <history-session /> <custom-history-session /> </history-session-chain> [...] </transaction-context>
-
2. Re: JBPM 4.0 HistoryEvent, HistorySession
sirfrancisdrake Sep 29, 2009 9:00 AM (in response to tcr)Hi tcr,
do you have found a solution for your problem ?
or does anybody else have a solution for this problem.
i would also like to use a customized history event for tracking and some informational tasks.
regards
SirFrancis