List<?> results;
switch (type){
case NODE_DATA:
generator = new QueryGenerator(NODE_DATA);
generator.setParameter(NodeDataConstants.WORKFLOW_INSTANCE_ID, workflowInstanceID);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
Node_Data nodeData = (Node_Data)result;
NodeDataResource nodeDataResource = (NodeDataResource)Utils.getResource(ResourceType.NODE_DATA,nodeData);