AnsweredAssumed Answered

Start Process by Disabling Validation

Question asked by zohaibjabbar on Mar 1, 2016
Latest reply on Mar 7, 2016 by zohaibjabbar
Hi,

I am parsing a bpmn file using Activiti and all goes well. However, if I do not define any 'script' in Script Task then bpmn file will not get deployed. I was going through the functions and came across "disableValidation" function. Now when I call this function and deploy the process, then process will not start.


DeploymentBuilder d = repositoryService.createDeployment();
         d.addClasspathResource("bpmnFiles/"+fileName);
         d.disableBpmnValidation();
         Deployment dep = d.deploy();

         runtimeService = processEngine.getRuntimeService();
         processInstance = runtimeService.startProcessInstanceByKey("myProcess");


A Null Pointer exception is thrown at the last line of code.


java.lang.NullPointerException
   at org.activiti.engine.impl.juel.Scanner.next(Scanner.java:452)
   at org.activiti.engine.impl.juel.Parser.consumeToken(Parser.java:252)
   at org.activiti.engine.impl.juel.Parser.tree(Parser.java:277)
   at org.activiti.engine.impl.juel.Builder.build(Builder.java:95)
   at org.activiti.engine.impl.juel.TreeStore.get(TreeStore.java:61)
   at org.activiti.engine.impl.juel.TreeValueExpression.<init>(TreeValueExpression.java:62)
   at org.activiti.engine.impl.juel.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:428)
   at org.activiti.engine.impl.juel.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:73)
   at org.activiti.engine.impl.scripting.JuelScriptEngine.parse(JuelScriptEngine.java:142)
   at org.activiti.engine.impl.scripting.JuelScriptEngine.eval(JuelScriptEngine.java:86)
   at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)


Can I deploy and start the process if no script is available in script task?
My only purpose is to get BpmnModel Object for this xml file.

Outcomes