我想通过数据库(扫描)的循环事件添加代理(资源)的数量(参数)。我以前不使用 Exit Block。 这一切都适用于 1 个周期,然后我收到 NullPointerExeption 错误。 也许你们中的一些人可以提供帮助……搜索了所有问题,但找不到答案。
这是我到目前为止尝试过的..
parameter = (int) selectFrom(scans)
.where(scans.al_id.gt(id))
.firstResult(scans.scans);
for(int i=0; i<parameter; i++){
Ressource ressource = new Ressource ();
enter.take(ressource);
};
id++;
首先创建一个称为资源的代理群体,
完成后,而不是使用 new Ressource();
你可以做添加
add_ressources();
无论如何,您的空点异常可能与此无关。但是当您使用 new Ressource() 创建代理时; 你应该添加这一行:
ressource.createAndStart(this);