/** * @author Joram Barrez */ public class UelExpressionTest extends PluggableActivitiTestCase {
@Deployment public void testValueAndMethodExpression() { // An order of price 150 is a standard order (goes through an UEL value expression) UelExpressionTestOrder order = new UelExpressionTestOrder(150); ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("uelExpressions", CollectionUtil.singletonMap("order", order)); Task task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); assertEquals("Standard service", task.getName()); // While an order of 300, gives us a premium service (goes through an UEL method expression) order = new UelExpressionTestOrder(300); processInstance = runtimeService.startProcessInstanceByKey("uelExpressions", CollectionUtil.singletonMap("order", order)); task = taskService.createTaskQuery().processInstanceId(processInstance.getId()).singleResult(); assertEquals("Premium service", task.getName()); }
}
I have export the java class and place it in the following locations,
While running the java class using juint ,i got the error like …
EXCEPTION: org.activiti.engine.ActivitiException: resource 'org/activiti/examples/bpmn/expression/UelExpressionTest.testValueAndMethodExpression.bpmn20.xml' not found org.activiti.engine.ActivitiException: resource 'org/activiti/examples/bpmn/expression/UelExpressionTest.testValueAndMethodExpression.bpmn20.xml' not found at org.activiti.engine.impl.repository.DeploymentBuilderImpl.addClasspathResource(DeploymentBuilderImpl.java:59) at org.activiti.engine.impl.test.TestHelper.annotationDeploymentSetUp(TestHelper.java:95) at org.activiti.engine.impl.test.AbstractActivitiTestCase.runBare(AbstractActivitiTestCase.java:88) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Oct 29, 2012 2:29:20 PM org.activiti.engine.impl.test.AbstractActivitiTestCase assertAndEnsureCleanDb INFO: database was clean
But the xml file is there in the corresponding location. Please help me.What i have missed.
Hello, In java we declared a variable in the same class itself(if not using POJO classes means). I asked activiti class ,in the activiti class itself i have declared the variables frm the same class.