Task Generator
The following sample Task Generator fetches all of the item ids. Creates a Task object for each Item. Then passes that list of Tasks back to Platform. Platform takes the list of tasks and inserts the tasks into the system. The insert is a prepared statement and it in of itself is considered performant. The reading of all the items or other master data is the reason why this technique is not strongly favored.
/** * @see com.transcendsys.platform.ixm.fmwk.IXMEngineTaskGenerator#generateIXMTaskList(org.json.JSONObject) */ @Override public TaskInfo[] generateIXMTaskList(JSONObject taskFilters) throws CoreIXMException { List<Long> itemIds = fetchItemIds(itemId, itemPlannerCode, entName, supplierId, startIndex, endIndex); taskInfos.addAll(generateInnerTasks(itemIds, taskFilters, dvceContext)); if (LOG.isDebugEnabled()) { LOG.debug("IP Task Generator End"); } /** * Setting the enterprise with a common identifier in all the task generators * So that it can be fetched inside TaskInfoTaskWriteAdaptor in a generic way. */ taskFilters.put(ENT_NAME_TO_CREATE_TASKGEN_BIZlOGGER_DOC, entName); return taskInfos.toArray(new TaskInfo[0]); }