Activiti Error Handling

error end event 和 error boundary event

java 中处理异常

ws设计

流程图,java处理异常 结合 error end and boundary event

用bpmn designer 设计

在Activiti designer 上展示流程图

设计分支条件

配form

<endEvent id="errorendevent1">  
    <errorEventDefinition errorRef="customerNotFound" />
</endEvent>

error end event code配置

<error id="customerNotFound" errorCode="123" />

错误定义

<boundaryEvent id="boundaryerror1"
               attachedToRef="subprocess1">
  <errorEventDefinition errorRef="customerNotFound" />
</boundaryEvent>

error bounday event 定义

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-codegen-plugin</artifactId>
      <version>2.3.4</version>
      <executions>
        <execution>
          <id>generate-sources</id>
          <phase>generate-sources</phase>
          <configuration>
            <sourceRoot>generated/cxf</sourceRoot>
            <wsdlOptions>
              <wsdlOption>
                <wsdl>src/main/resources/chapter7/errorevent/
                      wsdl/customerService.wsdl</wsdl>
                <wsdlLocation>http://localhost:8081/book-sales-app/
                       services/customer?wsdl</wsdlLocation>
              </wsdlOption>
            </wsdlOptions>
          </configuration>
          <goals>
            <goal>wsdl2java</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

在maven中添加插件,启动WS

java service中调用WS

配置service task

java service

生成 deploy artifacts

使用 Activiti explorer

使用java logic error handling

用于service task 的Java Service

<serviceTask id="RetrieveCustomerTask"    activiti:class="org.bpmnwithactiviti.chapter7.          errorjava.RetrieveCustomerTask" />

<sequenceFlow id="customerNotFound"    sourceRef="RetrieveCustomerTask"    targetRef="HandleCustomerNotFoundTask" />

<sequenceFlow id="customerFound"    sourceRef="RetrieveCustomerTask"    targetRef="StoreOpportunityTask" />

主要配置

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值