#include "epm_handler_common.h"
#include <tc\tc_macros.h>
#include <tc\emh.h>
#include <tc\preferences.h>
#include <property\propdesc.h>
#include <epm\epm.h>
#include <epm\epm_toolkit_tc_utils.h>
#include <tccore\item.h>
#include <tccore\grmtype.h>
#include <tccore\grm.h>
#include <tccore\imantype.h>
#include <sa\am.h>
#include <sa\sa.h>
#include <tccore\aom.h>
#include <tccore\aom_prop.h>
#include <property\prop_errors.h>
#include <tccore\workspaceobject.h>
#include <qry\qry.h>
#include <bom\bom_attr.h>
#include <bom\bom.h>
#include <epm\signoff.h>
#include <pom\pom\pom.h>
#include <pom\pom\pom_errors.h>
#include <fclasses\tc_date.h>
#include <epm\cr.h>
#include <cfm\cfm.h>
#include <sa\am.h>
#include "tc/envelope.h"
#include <stdio.h>
#include "ae/dataset.h"
#include <ctype.h>
#include <string.h>
#include <string>
#include <iostream>
#include <iterator>
#include <map>
#include <vector>
#include "ce/ce.h"
#include <time.h>
#include <windows.h>  
#include <iostream>  
#include <sql.h>  
#include <sqlext.h>  
#include "string"
#include "sstream"
#include <sa/tcfile.h>
#include <tccore/aom.h>
#include <sa/tcfile_cache.h>
#include "ctime"
#include "tchar.h"

using namespace std;
extern "C" int POM_AM__set_application_bypass(logical bypass);


int bs_signoff(EPM_action_message_t msg)
{
	int ifail = ITK_ok, att_count;
	tag_t rootTask, *attachments, user_tag;
	char  *action_string, *user_name, *task_name;
	map<string,string> map;
	time_t t = time(NULL);
	struct tm* local = localtime(&t);
	
	EPM_ask_name2(msg.task, &task_name);
	EPM_action_t action = msg.action;
	EPM_ask_action_string2(action, &action_string);

	POM_get_user(&user_name, &user_tag);

	EPM_ask_root_task(msg.task, &rootTask);

	EPM_ask_attachments(rootTask,EPM_target_attachment, &att_count, &attachments);
	
	return 0;
}

