[jboss-user] [jBPM] - Re: Invocation of rule task in JBPM - Using JPA and within Web App

Tihomir Surdilovic do-not-reply at jboss.com
Sat Nov 26 23:51:07 EST 2011


Tihomir Surdilovic [http://community.jboss.org/people/tsurdilovic] created the discussion

"Re: Invocation of rule task in JBPM - Using JPA and within Web App"

To view the discussion, visit: http://community.jboss.org/message/638491#638491

--------------------------------------------------------------
Not sure why you say you cannot use AgendaEventListener? Can you elaborate?
Here is one example (you have to do a little bit of casting...)


final org.drools.event.AgendaEventListener agendaEventListener = new org.drools.event.AgendaEventListener() {
public void activationCreated(ActivationCreatedEvent event,
WorkingMemory workingMemory){
}
public void activationCancelled(ActivationCancelledEvent event,
WorkingMemory workingMemory){
}
public void beforeActivationFired(BeforeActivationFiredEvent event,
WorkingMemory workingMemory) {
}
public void afterActivationFired(AfterActivationFiredEvent event,
WorkingMemory workingMemory) {
}
public void agendaGroupPopped(AgendaGroupPoppedEvent event,
WorkingMemory workingMemory) {
}

public void agendaGroupPushed(AgendaGroupPushedEvent event,
WorkingMemory workingMemory) {
}
public void beforeRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event,
WorkingMemory workingMemory) {
}
public void afterRuleFlowGroupActivated(RuleFlowGroupActivatedEvent event, 
WorkingMemory workingMemory) {
workingMemory.fireAllRules();
}
public void beforeRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
WorkingMemory workingMemory) {
}
public void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event,
WorkingMemory workingMemory) {
}
};
((StatefulKnowledgeSessionImpl)  ((KnowledgeCommandContext) ((CommandBasedStatefulKnowledgeSession) ksession)
.getCommandService().getContext()).getStatefulKnowledgesession() )
.session.addEventListener(agendaEventListener);
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/638491#638491]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111126/7b0c16ee/attachment-0001.html 


More information about the jboss-user mailing list