void updateTaskStatus ( Tenant tenant , TaskRecord taskRecord , boolean bDeleteClaimRecord ) { String taskID = taskRecord . getTaskID ( ) ; DBTransaction dbTran = DBService . instance ( tenant ) . startTransaction ( ) ; Map < String , String > propMap = taskRecord . getProperties ( ) ; for ( String name : propMap . keySet ( ) ) { String value = propMap . get ( name ) ; if ( Utils . isEmpty ( value ) ) { dbTran . deleteColumn ( TaskManagerService . TASKS_STORE_NAME , taskID , name ) ; } else { dbTran . addColumn ( TaskManagerService . TASKS_STORE_NAME , taskID , name , value ) ; } } if ( bDeleteClaimRecord ) { dbTran . deleteRow ( TaskManagerService . TASKS_STORE_NAME , "_claim/" + taskID ) ; } DBService . instance ( tenant ) . commit ( dbTran ) ; }
Add or update a task status record and optionally delete the task s claim record at the same time .