
#ifndef EPM_HANDLER_COMMON
#define EPM_HANDLER_COMMON

#include <epm/epm.h>
#include <string>
#include <map>


#ifdef __cplusplus
extern "C" {
#endif


	using namespace std;

	#define ERROR_QRY_NOT_FOUND (EMH_USER_error_base + 120)
#define TC_specification	"IMAN_specification"
int WX_Check_Property(EPM_rule_message_t msg);
int Modify_Attributes(EPM_rule_message_t msg);
int Check_range(EPM_rule_message_t msg);
int chint_getChgOrde(EPM_action_message_t msg);
int chint_getProduct(EPM_action_message_t msg);
int Remove_Release_Status(EPM_action_message_t msg);
int AddTime(EPM_action_message_t msg);
int AddReleaseStatus(EPM_action_message_t msg);
int AutomaticRelease(EPM_action_message_t msg);
int hasFillInChechList(EPM_action_message_t msg);
// int chintP(EPM_action_message_t msg);
int chintProperty(EPM_action_message_t msg);
int chint_signoff_dataset(EPM_action_message_t msg);
int chint_DesignProcess(EPM_action_message_t msg);
int chintSignChange(EPM_action_message_t msg);
int DbomToEMethod(void *returnValue);
int DbomToEMethodUser(void *returnValue);
int CloneTempProcess(void *returnValue);
int EbomToPMethod(void *returnValue);
int HXC_create_item_post(METHOD_message_t* msg , va_list va);//后操作
int AutoFeeding(void *returnValue);
int chint_pdf_signoff(EPM_action_message_t msg);
int chint_updateToPi(EPM_action_message_t msg);
int chint_add_to_workflow(EPM_action_message_t msg);
int chint_backCheckTable(EPM_action_message_t msg);
int chint_remove_other_deisgndata(EPM_action_message_t msg);
int chint_CheckTable_State(EPM_action_message_t msg); 
int chint_check_ZC_ZJ_BOM(EPM_action_message_t msg);
int chint_check_exist_ebom(EPM_action_message_t msg);
int UpdateWorkTime(void *returnValue);
int CHINT_task_complete(EPM_action_message_t msg);
int CHINT_cossheet_upgrade(EPM_action_message_t msg);
int CHINT_SendOAMaterial(EPM_action_message_t msg);
int CHINT_GetFrock(EPM_action_message_t msg);
int CHINT_ECN_SendOA(EPM_action_message_t msg);
int CHINT_Assignment(EPM_action_message_t msg);
int CHINT_SavePost(METHOD_message_t* msg, va_list args);
bool isTcm(tag_t mantr);
bool isBomViewTcm(tag_t mantr);
void TCMAndOwner(tag_t matnrTop);

int CHINT_yptask_complete(EPM_action_message_t msg);

int chint_ecn_signoff(EPM_action_message_t msg);
int chint_ecn_assign(EPM_action_message_t msg);

int CHINT_DRAWING_TO_SRM(EPM_action_message_t msg);
int chint_changenotice(EPM_action_message_t msg);
int chint_check_materialstatus(EPM_action_message_t msg);
int chint_changenoticebm(EPM_action_message_t msg);

int getBomDetails(void *returnValue);
int CHINT_CHANGEITEM_TO_SRM(EPM_action_message_t msg);
int CHINT_CHANGEBOM_TO_SRM(EPM_action_message_t msg);
int CHINT_CHANGETZCG_TO_SRM(EPM_action_message_t msg);
EPM_decision_t chint_csh_check(EPM_rule_message_t msg);

int AddReleasedStatus(void *);
	//user service end
#ifdef __cplusplus
}
#endif

#endif
#define OBJECT_NAME "object_name"
#define CCP_NAME "变压器"
#define OBJECTTYPE "object_type"
#define PROCURETYPE "ZT2_Procure Revision"
#define WBSNO "zt2_WBSNo"
#define MATERIALNO "zt2_MaterialNo"
#define REVISIONID "item_revision_id"
#define SPECIFICATION "IMAN_specification"
#define PDF "pdf"
#define S_GCDM "S_GCDM" //工厂
#define LOG_PATH "D:\\Siemens\\ECNtoOAlog" //工厂
#define PROP_GROUP_NAME "name" //组ID
#define MAX_PATH_LENGTHE 2000
#define JSON_TXDJ "S_txdj"
#define PROP_PRODUCT "zt2_SZProduct"
#define PROP_PROCESS "zt2_SZProcess"
#define S_ProductFeature "S_ProductFeature" //工厂
#define S_Product "产品"
#define S_Process "过程"
#define S_ZSChange "正式更改"
#define S_LSChange "临时更改"
#define BL_QUANTITY "bl_quantity"
#define BL_LINE_OBJECT "bl_line_object"
/*
#define ITKCALL( argument )                                             \
{                                                                       \
	int retcode = argument;                                             \
	if ( retcode != ITK_ok ) {                                          \
	char* s;                                                        \
	printf( " "#argument "\n" );                                    \
	printf( "  returns [%d]\n", retcode );                          \
	EMH_ask_error_text (retcode, &s);                               \
	TC_printf( "  Teamcenter ERROR: [%s]\n", s);           \
	printf( "  in file ["__FILE__"], line [%d]\n\n", __LINE__ );    \
	if (s != 0) MEM_free (s);                                       \
	}                                                                   \
}*/