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;
      }

    }

  • 相关阅读:
    江の島西浦写真館2-1
    江の島西浦写真館1-2
    Oracle 查询表空间使用情况
    Oracle 的开窗函数 rank,dense_rank,row_number
    oracle11G 用户密码180天修改概要文件过程
    CentOS6 安装 MySQL5.7
    linux下SS 网络命令详解
    CentOS6 网络设置
    redhat 6 红帽6 Linux 网络配置
    Oracle分析函数——函数列表
  • 原文地址:https://www.cnblogs.com/yg_zhang/p/1982447.html
Copyright © 2011-2022 走看看