Hi,
I got the following exception when trying to add from my code, a 'repeatEvery' (as a timer) loop into a "OnAlarm" Bpel element. I'm using the Eclipse BPEL API org.eclipse.bpel.model version 0.4.0 to read a bepl process and then modify it by adding elements.
Exception in thread "main" java.lang.NullPointerException
at org.eclipse.bpel.model.resource.BPELWriter.createBPELElement(BPELWriter.java:2359)
at org.eclipse.bpel.model.util.ElementFactory$MyBPELWriter.createBPELElement(ElementFactory.java:89)
at org.eclipse.bpel.model.resource.BPELWriter.expression2XML(BPELWriter.java:1894)
at org.eclipse.bpel.model.util.ElementFactory$MyBPELWriter.expression2XML(ElementFactory.java:116)
at org.eclipse.bpel.model.util.ElementFactory.createExpressionElement(ElementFactory.java:546)
at org.eclipse.bpel.model.impl.OnAlarmImpl.basicSetRepeatEvery(OnAlarmImpl.java:297)
at org.eclipse.bpel.model.impl.OnAlarmImpl.setRepeatEvery(OnAlarmImpl.java:332)
It happens when calling the "setRepeatEvery(..)" method.
Hereafter a piece of the code:
Expression exp= (Expression) obj; // obj: is an EObject which contains an" Expression" BPEL element that was created before;
Object bj=new Object(); // here it is just to test
exp.setBody(bj); // here it is just to test
OnAlarm onalr= (OnAlarm) container// container: is an EObject which contains a "OnAlarm" BPEL element that was created before;
onalr.setRepeatEvery(exp);
I did the same thing whith the "Wait" BPEL element which is of type "Activity" (from the BPEL specification), and i put inside it a "For" loop and it works!!
Why with "OnAlarm" BPEL element which is of type "ExtensibleElement" it doesn't work?!
Any suggestions please?
Thanks in advance.
[Updated on: Sat, 29 November 2014 13:08]
Report message to a moderator