#NEWLINE# def _format_action_exec_result( self , action_node , liveaction_db , created_at , updated_at , error = None ) : #NEWLINE# #INDENT# '\n        Format ActionExecution result so it can be used in the final action result output.\n\n        :rtype: ``dict``\n        ' #NEWLINE# assert isinstance ( created_at , datetime . datetime ) #NEWLINE# assert isinstance ( updated_at , datetime . datetime ) #NEWLINE# result = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# execution_db = None #NEWLINE# if liveaction_db : #NEWLINE# #INDENT# execution_db = ActionExecution . get ( liveaction__id = str ( liveaction_db . id ) ) #NEWLINE# #UNINDENT# result [ 'id' ] = action_node . name #NEWLINE# result [ 'name' ] = action_node . name #NEWLINE# result [ 'execution_id' ] = ( str ( execution_db . id ) if created_at else None ) #NEWLINE# result [ 'workflow' ] = None #NEWLINE# result [ 'created_at' ] = isotime . format ( dt = created_at ) #NEWLINE# result [ 'updated_at' ] = isotime . format ( dt = updated_at ) #NEWLINE# if ( error or ( not liveaction_db ) ) : #NEWLINE# #INDENT# result [ 'state' ] = LIVEACTION_STATUS_FAILED #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result [ 'state' ] = liveaction_db . status #NEWLINE# #UNINDENT# if error : #NEWLINE# #INDENT# result [ 'result' ] = error #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result [ 'result' ] = liveaction_db . result #NEWLINE# #UNINDENT# return result