Hello,
does anybody know what is the difference between thies two codes?
1- With this code I get "NullPointerException at process1.getCurrentNode();"
public void signal(ProcessEntity process) {
ProcessEntity process1 = getEntityManager().find(ProcessEntity.class,
process.getId());
if (process1 == null) {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
signal(process);
}
NodeEntity currentNode = process1.getCurrentNode();
if (currentNode == null) {
} else {
currentNode.run(this, process1);
}
}
2- "else" here solves this Problem!
public void signal(ProcessEntity process) {
ProcessEntity process1 = getEntityManager().find(ProcessEntity.class,
process.getId());
if (process1 == null) {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
signal(process);
} else {
NodeEntity currentNode = process1.getCurrentNode();
if (currentNode == null) {
} else {
currentNode.run(this, process1);
}
}
}
Please help me!!!
Best regards,
Amjad, Germany