07-22-2011 10:57 AM
<process id="seq-exception" name="seq-exception">
<startEvent id="startevent1" name="Start"></startEvent>
<serviceTask id="servicetask2" name="Sucess" activiti:delegateExpression="#{MyJavaDelegate}"></serviceTask>
<serviceTask id="servicetask1" name="Exception" activiti:delegateExpression="#{MyJavaDelegateWithException}"></serviceTask>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="servicetask2"></sequenceFlow>
<sequenceFlow id="flow2" name="" sourceRef="servicetask2" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow3" name="" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
</process>
@Component(value = "MyJavaDelegate")
public class MyJavaDelegate implements JavaDelegate {
private static final Logger logger = LoggerFactory.getLogger(MyJavaDelegate.class);
@Override
@Transactional
public void execute(DelegateExecution execution) throws Exception {
logger.info("MyJavaDelegate");
}
}
@Component(value = "MyJavaDelegateWithException")
public class MyJavaDelegateWithException implements JavaDelegate {
private static final Logger logger = LoggerFactory.getLogger(MyJavaDelegateWithException.class);
@Override
@Transactional
public void execute(DelegateExecution execution) throws Exception {
logger.info("MyJavaDelegateWithException");
throw new Exception("Dummy Exception");
}
}
public class MainBean {
@Autowired
private RuntimeService runtimeService;
public void execute(String processDefinitionKey, String businessKey) {
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processDefinitionKey,
businessKey);
}
}
07-22-2011 11:38 AM
07-22-2011 02:04 PM
07-23-2011 06:48 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.