Lipsa Pradhan
Lipsa Pradhan

Reputation: 3

Unable to instantiate a class from WSO2 BPMN explorer

I had designed a bpmn(using activiti in eclipse) and deployed it successfully on the BPS server but now when I am trying to start the process in BPMN explorer, I'm facing this issue: Error starting process: couldn't instantiate class org.wso2.Mymaven.App.

I had used two user task, one service task and one mail task in the BPMN, and the service task is using the above-mentioned class.

I have followed all the steps mentioned in this tutorial " http://wso2.com/library/tutorials/2016/03/tutorial-how-to-model-your-business-processes-with-wso2-business-process-server/ ". Till step 10 (fig.26), everything is working fine but after that, I'm facing the issue "Error starting process: couldn't instantiate class org.wso2.Mymaven.App"

The java code used is :

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

Upvotes: 0

Views: 670

Answers (1)

vinod
vinod

Reputation: 151

Did you deploy the jar file with that class into BPS? You need to copy that jar file into /repository/components/lib folder and restart the server.

Upvotes: 0

Related Questions