【HongSoft:业务流程平台】

【杨洪波,网名HongSoft,致力于业务流程】【工作领域:BPP,BPM,SOA】

收藏
    相册
    《程序员》
    j2se发展演变史(RSS)
    有效实施业务敏捷(RSS)
    《软件世界》
    SOA标准规范组织与案例分析(RSS)
    从世界是平的看软件架构(RSS)
    企业应用开发2.0开源趋势(RSS)
    工作流:三分天下(RSS)
    《微型机与应用》
    安全文件系统PGPDisk的设计与实现
    《银弹》
    SOA与开源双剑合一 (RSS)
    SOA浪潮下的BPM(RSS)
    工作流培训与咨询客户
    上海复旦金仕达卫宁(RSS)
    华信邮电研究院软件研究发展中心(RSS)
    深圳市国税局信息中心(RSS)
    我的BPEL活动
    ActiveBPEL开源文档(RSS)
    BEA UG活动(RSS)
    BPEL采访(RSS)
    我的SOA活动
    CSDN 2007 MVB(RSS)
    SOA聚会采访(RSS)
    我的工作流活动
    goCom技术日(RSS)
    工作流专题(RSS)
    工作流开发框架AgileFLow(RSS)
    智能工作流系统Smart(RSS)
    存档
    订阅我的博客
    XML聚合  FeedSky

    原创 用jbpm_bpel学jwsdp的ant方式使用收藏

    新一篇: build the eclipse project of tucany sdo | 旧一篇: open source软件的版权问题

    用过jwsdp的同学都知道,它专门有个jwsdp-2_0-ant-docs文挡 ,可见ant与jwsdp结合的重要性。

    在用jbpm-bpel的时候,当然也是最好用ant方式的jwsdp的,下面就是某个example的具体过程:

     

    我们看jbpm-bpel-1.1.Beta3的examples/account/build.xml
    <?xml version="1.0"?>
    <project name="account" default="redeploy"> 
      <import file="../common/ws-build.xml"/>
    </project>

    转到common下的ws-build.xml的redeploy:
    <target name="redeploy"
              depends="generate-artifacts, deploy"
              description="regenerate artifacts and deploy application" />
    1.generate-artifacts  
    2.deploy

    1的内容如下:
    <target name="generate-artifacts"
              depends="detect-wsgenerator"
              description="generate java mapping artifacts">
        <mkdir dir="${output.java.dir}" />
        <antcall target="setup-wstools" />
        <antcall target="setup-wscompile" />
    </target>
    1.1 detect-wsgenerator
    1.2 setup-wstools
    1.3 setup-wscompile

     

    1.1的内容如下:
     <target name="detect-wsgenerator">
        <available property="wstools.available"
                   classname="org.jboss.ws.tools.ant.wstools"
                   classpathref="jboss.path" />
        <condition property="wsgenerator.available">
          <or>
            <isset property="wstools.available" />
            <isset property="jwsdp.home" />
          </or>
        </condition>
        <fail message="no artifacts generator available"
              unless="wsgenerator.available" />
      </target>
    这段首先是找  org.jboss.ws.tools.ant.wstools这个资源是否存在;如果存在,则wstools.available
    赋值为true。
    然后判断 wstools.available已经有值或者jwsdp.home已经有值,如果是,则 wsgenerator.available为true。
    最后,判断 如果wsgenerator.available为false,就要抛出fail message :"no artifacts generator available"。

    1.2的内容如下:
    <target name="setup-wstools" if="wstools.available" unless="jwsdp.home">
        <taskdef name="wstools"
                 classname="org.jboss.ws.tools.ant.wstools"
                 classpathref="wstools.path" />
        <antcall target="call-wstools" />
      </target>
    首先就是定义名称为wstools的任务,对应的类是 org.jboss.ws.tools.ant.wstools;
    然后调用call-wstools任务。

    call-wstools任务如下:
    <target name="call-wstools">
        <wstools dest="${output.java.dir}" config="${resources.dir}/wstools.xml" />
        <move file="${output.java.dir}/jaxrpc-mapping.xml"
              todir="${output.web.dir}" />
      </target>

    1.2.1 wstools,传了两个参数进去
    1.2.2 move操作。


    1.3 setup-wscompile的内容如下:
    <target name="setup-wscompile" if="jwsdp.home">
        <taskdef name="wscompile"
                 classname="com.sun.xml.rpc.tools.ant.Wscompile"
                 classpathref="wscompile.path" />
        <mkdir dir="${output.classes.dir}" />
        <mkdir dir="${output.web.dir}" />
        <antcall target="call-wscompile" />
        <delete>
          <fileset dir="${output.java.dir}" includes="**/*_Impl.java" />
          <fileset dir="${output.classes.dir}" includes="**/*_Impl.class" />
        </delete>
      </target>
    首先就是定义wscompile任务,对应的类是 com.sun.xml.rpc.tools.ant.Wscompile;
    mkdir然后调用wscompile任务。

    1.3.1 wscompile任务如下:
    <target name="call-wscompile">
        <wscompile fork="on"
                   verbose="on"
                   import="on"
                   keep="on"
                   features="norpcstructures,wsi,strict"
                   base="${output.classes.dir}"
                   sourcebase="${output.java.dir}"
                   mapping="${output.web.dir}/jaxrpc-mapping.xml"
                   config="${resources.dir}/wscompile.xml"
                   classpathref="wscompile.path"
                   jvmargs="-Duser.dir=${project.dir}" />
      </target>
    1.3.2 是delete两个目录下的东西

    2的内容如下:
     <target name="deploy"
              depends="pack-web"
              description="deploy application to server">
        <copy todir="${jboss.server.deploy.dir}"
              file="${output.dir}/${module.name}.war" />
      </target>

    2.1 pack-web的内容如下:
    <target name="pack-web" depends="compile">
        <war warfile="${output.dir}/${module.name}.war" webxml="${web.dir}/web.xml">
          <classes dir="${output.classes.dir}" />
          <webinf dir="${web.dir}" excludes="web.xml" />
          <webinf dir="${output.web.dir}" />
        </war>
      </target>
    2.2是copy目录。

    就是上面这些过程了,执行结果如下;
    Buildfile: D:\jbpm-bpel-1.1.Beta3\examples\account\build.xml
    detect-wsgenerator:
    generate-artifacts:
    setup-wstools:
    setup-wscompile:
        [mkdir] Created dir: D:\jbpm-bpel-1.1.Beta3\examples\account\target\classes
        [mkdir] Created dir: D:\jbpm-bpel-1.1.Beta3\examples\account\target\resources\web
    call-wscompile:
    [wscompile] command line: wscompile D:\eos6\jdk1.5.0_09\jre\bin\java.exe -Duser.dir=D:\jbpm-bpel-1.1.Beta3\examples\account -classpath D:\jwsdp\jaxrpc\lib\jaxrpc-api.jar;D:\jwsdp\jaxrpc\lib\jaxrpc-impl.jar;D:\jwsdp\jaxrpc\lib\jaxrpc-spi.jar;D:\eos6\jdk1.5.0_09\lib\tools.jar;D:\jbpm-bpel-1.1.Beta3\examples\account\src\main\resources com.sun.xml.rpc.tools.wscompile.Main -d D:\jbpm-bpel-1.1.Beta3\examples\account\target\classes -features:norpcstructures,wsi,strict -import -keep -mapping D:\jbpm-bpel-1.1.Beta3\examples\account\target\resources\web\jaxrpc-mapping.xml -s D:\jbpm-bpel-1.1.Beta3\examples\account\target\java -verbose D:\jbpm-bpel-1.1.Beta3\examples\account\src\main\resources\wscompile.xml
    [wscompile] [ServiceInterfaceGenerator: creating service interface: org.jbpm.bpel.tutorial.account.AccountService]
    [wscompile] [CustomClassGenerator: generating JavaClass for: AccountOperation]
       [delete] Deleting 1 files from D:\jbpm-bpel-1.1.Beta3\examples\account\target\java
       [delete] Deleting 1 files from D:\jbpm-bpel-1.1.Beta3\examples\account\target\classes
    compile:
        [javac] Compiling 2 source files to D:\jbpm-bpel-1.1.Beta3\examples\account\target\classes
         [copy] Copying 1 file to D:\jbpm-bpel-1.1.Beta3\examples\account\target\classes
    pack-web:
          [war] Building war: D:\jbpm-bpel-1.1.Beta3\examples\account\target\account.war
    deploy:
         [copy] Copying 1 file to D:\eos6\app_server\jboss-4.0.5\server\default\deploy
    redeploy:
    BUILD SUCCESSFUL
    Total time: 9 seconds

    发表于 @ 2007年07月20日 14:27:00|评论(loading...)|收藏

    新一篇: build the eclipse project of tucany sdo | 旧一篇: open source软件的版权问题

    评论

    #zhwh 发表于2007-08-09 20:38:08  IP: 220.169.30.*
    楼主同志,给你发了个关于学习shark的邮件,N年了都没有回复。得了,自己看文档,自己解决问题。
    #zhouxz1026 发表于2008-05-29 16:07:37  IP: 125.106.100.*
    学习了!
    蜂胶
    蜂蜜
    #shendl 发表于2008-08-20 13:55:17  IP: 211.144.96.*
    #zhwh 发表于2007-08-09 20:38:08 IP: 220.169.30.*
    楼主同志,给你发了个关于学习shark的邮件,N年了都没有回复。得了,自己看文档,自己解决问题。
    ============要靠自己学习,行不?!人家又没收你钱,免费公开技术心得已经不错了!每个人都有自己的事情的,好吗?!!!
    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © 杨洪波(HongSoft)