0

我设计了一个 bpmn(在 eclipse 中使用 activiti)并将其成功部署在 BPS 服务器上,但现在当我尝试在 BPMN 资源管理器中启动进程时,我遇到了这个问题: 错误启动进程:无法实例化类 org .wso2.Mymaven.App。

我在BPMN中使用了两个用户任务,一个服务任务和一个邮件任务,服务任务就是使用上面提到的类。

我已按照本教程中提到的所有步骤“ http://wso2.com/library/tutorials/2016/03/tutorial-how-to-model-your-business-processes-with-wso2-business-process-server / "。直到第 10 步(图 26),一切正常,但在那之后,我遇到了“错误启动过程:无法实例化类 org.wso2.Mymaven.App”的问题

使用的java代码是:

package org.wso2.Mymaven;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import java.lang.Long;
import java.util.Random;

public class App implements JavaDelegate{
   public void execute(DelegateExecution execution) throws Exception {
       int billAmount = Integer.parseInt((String)execution.getVariable("amount"));
       Random randomGenerator = new Random();
       int value = randomGenerator.nextInt(20);
       int result = (billAmount * value);

       execution.setVariable("result", "" + result);     
    }
}
4

1 回答 1

0

您是否将带有该类的 jar 文件部署到 BPS 中?您需要将该 jar 文件复制到 /repository/components/lib 文件夹并重新启动服务器。

于 2017-05-14T11:03:55.037 回答