}
NodeInstanceFactoryRegistry nodeRegistry =
((InternalRuleBase) ((ProcessInstance) getProcessInstance()).getWorkingMemory().getRuleBase())
.getConfiguration().getProcessNodeInstanceFactoryRegistry();
NodeInstanceFactory conf = nodeRegistry.getProcessNodeInstanceFactory(node);
if (conf == null) {
throw new IllegalArgumentException("Illegal node type: " + node.getClass());
}
NodeInstanceImpl nodeInstance = (NodeInstanceImpl) conf.getNodeInstance(node, getProcessInstance(), this);
if (nodeInstance == null) {
throw new IllegalArgumentException("Illegal node type: " + node.getClass());
}
return nodeInstance;
}