zoukankan      html  css  js  c++  java
  • 直接修改jpbm xml流程定义字段的方法

    找到了一个直接修改流程定义字段的方法。

    package org.jbpm.pvm.internal.cmd;

    import java.io.IOException;
    import java.io.InputStream;

    import org.jbpm.api.JbpmException;
    import org.jbpm.api.cmd.Command;
    import org.jbpm.api.cmd.Environment;
    import org.jbpm.pvm.internal.session.RepositorySession;
    import org.jbpm.pvm.internal.util.IoUtil;

    /**
     * @author Tom Baeyens
     */
    public class UpdateDeploymentResourceCmd implements Command<Void> {

      private static final long serialVersionUID = 1L;

      protected String deploymentId;
      protected String resourceName;
      protected byte[] bytes;

      public UpdateDeploymentResourceCmd(String deploymentId, String resourceName,
        InputStream inputStream) {
        this.deploymentId = deploymentId;
        this.resourceName = resourceName;
        try {
          bytes = IoUtil.readBytes(inputStream);
        }
        catch (IOException e) {
          throw new JbpmException("could not read resource: " + resourceName, e);
        }
        finally {
          IoUtil.close(inputStream);
        }
      }

      public Void execute(Environment environment) throws Exception {
        RepositorySession repositorySession = environment.get(RepositorySession.class);
        repositorySession.updateDeploymentResource(deploymentId, resourceName, bytes);
        return null;
      }

    }

  • 相关阅读:
    JAVA视频网盘分享
    IntelliJ IDEA 2016 完美破解+汉化补丁
    献给java求职路上的你们
    java集合类
    MyEclipse编码设置
    国内外有名的java论坛
    百度编辑器ueditor的简单使用
    工厂模式
    Java静态工厂的理解
    git clone index-pack failed
  • 原文地址:https://www.cnblogs.com/yg_zhang/p/1982447.html
Copyright © 2011-2022 走看看