03-20-2013 10:35 AM
public class ActivitiParseListener extends AbstractBpmnParseListener {
private ExecutionListener executionListener;
public ActivitiParseListener(ExecutionListener executionListener) {
this.executionListener = executionListener;
}
@Override
public void parseCallActivity(Element callActivityElement, ScopeImpl scope, ActivityImpl activity) {
activity.addExecutionListener(ExecutionListener.EVENTNAME_START, executionListener);
}
}
<bean id="unittestProcessEngineConfiguration" parent="mailDisabledProcessEngineConfiguration">
<property name="customDefaultBpmnParseHandlers">
<list>
<bean class="….demo.utils.ActivitiParseListener">
<constructor-arg name="activitiExecutionListener" ref="activitiExecutionListener"/>
</bean>
</list>
</property>
</bean>
public class ActivitiParseListener implements BpmnParseHandler {
//ActivitiExecutionListener is my class
private ActivitiExecutionListener activitiExecutionListener;
public ActivitiParseListener(ActivitiExecutionListener activitiExecutionListener) {
this.activitiExecutionListener = activitiExecutionListener;
}
@Override
public Collection<Class<? extends BaseElement>> getHandledTypes() {
List<Class<? extends BaseElement>> classList = new ArrayList<Class<? extends BaseElement>>();
classList.add(CallActivity.class);
return classList;
}
@Override
public void parse(BpmnParse bpmnParse, BaseElement element) {
bpmnParse.setListenerFactory(new SomListenerFactory(activitiExecutionListener));
}
…
public class SomListenerFactory extends DefaultListenerFactory {
//ActivitiExecutionListener is my class
private ActivitiExecutionListener activitiExecutionListener;
public SomListenerFactory(ActivitiExecutionListener activitiExecutionListener) {
this.activitiExecutionListener = activitiExecutionListener;
}
@Override
public ExecutionListener createDelegateExpressionExecutionListener(ActivitiListener activitiListener) {
return activitiExecutionListener;
}
}
<bean id="unittestProcessEngineConfiguration" parent="mailDisabledProcessEngineConfiguration">
<property name="customDefaultBpmnParseHandlers">
<list>
<bean class="….demo.utils.ActivitiParseListener">
<constructor-arg name="activitiExecutionListener" ref="activitiExecutionListener"/>
</bean>
</list>
</property>
</bean>
03-21-2013 04:02 AM
public class CustomUserTaskBpmnParseHandler extends ServiceTaskParseHandler {
protected void executeParse(BpmnParse bpmnParse, ServiceTask serviceTask) {
// Do the regular stuff
super.executeParse(bpmnParse, serviceTask);
// Make always async
ActivityImpl activity = findActivity(bpmnParse, serviceTask.getId());
activity.setAsync(true);
}
}
03-22-2013 05:34 AM
<bean id="myProcessEngineConfiguration" parent="someProcessEngineConfiguration">
<property name="customDefaultBpmnParseHandlers">
<list>
<bean class="….demo.parse.CallActivityParseHandler">
<constructor-arg name="executionListener" ref="activitiExecutionListener"/>
</bean>
</list>
</property>
</bean>
03-22-2013 11:33 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.