You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.3 KiB

#include "util.h"
int jd_get_target(EPM_action_message_t msg) {
POM_AM__set_application_bypass(true);
tag_t root_task, *attachments;
int att_cnt;
stringstream ss;
EPM_ask_root_task(msg.task, &root_task);
EPM_ask_attachments(root_task, EPM_target_attachment, &att_cnt, &attachments);
for (int i = 0; i < att_cnt; i++) {
char *item_id, *item_revision_id;
if (isTypeOf(attachments[i], "ItemRevision")) {
AOM_ask_value_string(attachments[i], "item_id", &item_id);
AOM_ask_value_string(attachments[i], "item_revision_id", &item_revision_id);
ss << item_id;
ss << "/";
ss << item_revision_id;
ss << ",";
}
}
string temp = ss.str().substr(0, ss.str().length() - 1);
cout << temp.c_str() << endl;
AOM_set_value_string(root_task, "object_desc", temp.c_str());
AOM_save(root_task);
//char **p = (char **)malloc(sizeof(char *));
//p[0] = (char *)malloc(sizeof(char) * 2000);
//p[0] = (char *)temp.c_str();
//ITKCALL(PREF_set_char_values("jd2_task_target", 1, p));
//free(p);
POM_AM__set_application_bypass(false);
//ofstream out;
//stringstream file_location;
//file_location << getenv("temp");
//file_location << "\\";
//file_location << "jd2_task_target.txt";
//out.open(file_location.str().c_str(), ios::out | ios::trunc);
//out << temp.c_str() << endl;
//out.close();
return 0;
}