PersistenceContext context = ((PersistenceContextManager) env.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER )).getCommandScopedPersistenceContext();
workItemInfo = context.persist( workItemInfo );
((WorkItemImpl) workItem).setId(workItemInfo.getId());
workItemInfo.transform();
if (this.workItems == null) {
this.workItems = new HashMap<Long, WorkItemInfo>();
}
workItems.put(workItem.getId(), workItemInfo);