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

    }

  • 相关阅读:
    国产开源软件
    Tomcat系统架构
    移动端前端常见的触摸相关事件touch、tap、swipe
    spring配置文件详解
    Java获取文件中视频的时长
    java命令行导出、导入sql文件
    Java国密相关算法(bouncycastle)
    Java中将对象转换为Map的方法
    Virtual Box虚拟机下CentOS网络设置
    VirtualBox安装虚拟机全过程
  • 原文地址:https://www.cnblogs.com/yg_zhang/p/1982447.html
Copyright © 2011-2022 走看看