private TaskRecord storeTaskRecord ( Tenant tenant , Task task ) { DBTransaction dbTran = DBService . instance ( tenant ) . startTransaction ( ) ; TaskRecord taskRecord = new TaskRecord ( task . getTaskID ( ) ) ; Map < String , String > propMap = taskRecord . getProperties ( ) ; assert propMap . size ( ) > 0 : "Need at least one property to store a row!" ; for ( String propName : propMap . keySet ( ) ) { dbTran . addColumn ( TaskManagerService . TASKS_STORE_NAME , task . getTaskID ( ) , propName , propMap . get ( propName ) ) ; } DBService . instance ( tenant ) . commit ( dbTran ) ; return taskRecord ; }
Create a TaskRecord for the given task and write it to the Tasks table .