|
|
#include "util.h"
|
|
|
|
|
|
int jd_check_wlms_len(EPM_rule_message_t msg) {
|
|
|
POM_AM__set_application_bypass(true);
|
|
|
tag_t root_task, *attachments;
|
|
|
int att_cnt;
|
|
|
EPM_ask_root_task(msg.task, &root_task);
|
|
|
//获得根任务下的组件
|
|
|
EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt, &attachments);
|
|
|
stringstream oss;
|
|
|
for (int i = 0; i < att_cnt; i++) {
|
|
|
if (isTypeOf(attachments[i], "ItemRevision")) {
|
|
|
int form_att;
|
|
|
tag_t *forms;
|
|
|
AOM_ask_value_tags(attachments[i], "IMAN_master_form_rev", &form_att, &forms);
|
|
|
if (form_att == 0) {
|
|
|
continue;
|
|
|
}
|
|
|
char *wlms;
|
|
|
char *item_id;
|
|
|
AOM_ask_value_string(forms[0], "jd2_wlms", &wlms);
|
|
|
AOM_ask_value_string(attachments[i], "item_id", &item_id);
|
|
|
cout << "jd2_wlms:" << wlms << endl;
|
|
|
int length = 0;
|
|
|
for (int i = 0; wlms[i] != 0; i++) {
|
|
|
if (wlms[i] < 128 && wlms[i]>0) {
|
|
|
length++;
|
|
|
} else {
|
|
|
i += 1;
|
|
|
length++;
|
|
|
}
|
|
|
}
|
|
|
cout << "length: " << length << endl;
|
|
|
if (length > 40) {
|
|
|
POM_AM__set_application_bypass(false);
|
|
|
cout << "ID : " << item_id << endl;
|
|
|
string a = "ID : ";
|
|
|
string b = " , length : ";
|
|
|
// string c = " , 字符不能超过40!!!";
|
|
|
|
|
|
oss << a << item_id << b << length << endl;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (oss.str().length() > 0) {
|
|
|
return EMH_store_error_s1(EMH_severity_error, EMH_IDGENERATION_ERROR_BASE, oss.str().c_str());
|
|
|
}
|
|
|
POM_AM__set_application_bypass(false);
|
|
|
return EPM_go;
|
|
|
} |