|
|
| (46 intermediate revisions by 7 users not shown) |
| Line 1: |
Line 1: |
| − | Feel free to try out the wiki syntax in this page.<br>
| + | <ipbwiki_topiclist forumid=4,5 count=5 /> |
| − | <!-- test your skills below this line -->
| + | |
| − | | + | |
| − | <rss desc=off>http://www.servicedeskusers.com/forum/index.php?act=rssout&id=8</rss>
| + | |
| − | | + | |
| − | [[Category:CA Workflow]]
| + | |
| − | | + | |
| − | This is an example of the workflow to obtain the group members from Servicedesk. Follow the directions exactly
| + | |
| − | | + | |
| − | <source lang=xml>
| + | |
| − | </topointnormal>
| + | |
| − | <topointswimlane>-1</topointswimlane>
| + | |
| − | <to>1170219743489</to>
| + | |
| − | <sequence>-1</sequence>
| + | |
| − | <label />
| + | |
| − | <description /> >-16777216</lineColor>
| + | |
| − | </transition>
| + | |
| − | </transitions>
| + | |
| − | </duedateprocessing>
| + | |
| − | <preprocessing />
| + | |
| − | <postprocessing />
| + | |
| − | <executioncontexts />
| + | |
| − | <exceptionhandlers />
| + | |
| − | </subactivity>
| + | |
| − | </nodes>
| + | |
| − | - <transitions>
| + | |
| − | - <transition id="1164858697231">
| + | |
| − | <from>1509732671450107440</from>
| + | |
| − | <frompointnormal>-1</frompointnormal>
| + | |
| − | <frompointswimlane>-1</frompointswimlane>
| + | |
| − | <topointnormal>-1</topointnormal>
| + | |
| − | <topointswimlane>-1</topointswimlane>
| + | |
| − | <to>1164858205749</to>
| + | |
| − | <sequence>-1</sequence>
| + | |
| − | <label />
| + | |
| − | <description />
| + | |
| − | <done>N</done>
| + | |
| − | <condition />
| + | |
| − | <lineWidth>1</lineWidth>
| + | |
| − | <lineColor>-16777216</lineColor>
| + | |
| − | </transition>
| + | |
| − | </transitions>
| + | |
| − | </process>
| + | |
| − | </processes>
| + | |
| − | </processdefinition>
| + | |
| − | </source>
| + | |
| − | | + | |
| − | | + | |
| − | == code ==
| + | |
| − | | + | |
| − | <source lang=javascript>
| + | |
| − | OBJECT cr {
| + | |
| − | TRIGGERS {
| + | |
| − | POST_VALIDATE zcr_cancel_events() 444 FILTER(EVENT("UPDATE") && (status { 'RE' -> }));
| + | |
| − | };
| + | |
| − | };
| + | |
| − | | + | |
| − | | + | |
| − | | + | |
| − | cr::zcr_cancel_events(...){
| + | |
| − | // Building query
| + | |
| − | send_wait(0, top_object(), "call_attr", "atev", "sync_fetch", "STATIC", format("(event_tmpl = '%s' OR event_tmpl = '%s') AND obj_id = '%s'", "evt:400001", "evt:400002", persistent_id), -1, 0);
| + | |
| − | if (msg_error()) {
| + | |
| − | set_error(msg_error());
| + | |
| − | set_return_data(msg[0]);
| + | |
| − | logf(ERROR, "Cannot get attached events for %s %s - %s", type, ref_num, msg[0]);
| + | |
| − | return;
| + | |
| − | } else {
| + | |
| − | logf(SIGNIFICANT, "Got atev list for %s %s", type, ref_num);
| + | |
| − | }
| + | |
| − | | + | |
| − | // Building attached event list from query results
| + | |
| − | object atev_list;
| + | |
| − | atev_list = msg[0];
| + | |
| − | int thelength;
| + | |
| − | thelength = 0;
| + | |
| − | thelength = msg[1];
| + | |
| − | if (msg_error()) {
| + | |
| − | logf(ERROR, "error getting length of atev list for %s %s - %s", type, ref_num, msg[0]);
| + | |
| − | return;
| + | |
| − | } else {
| + | |
| − | logf(SIGNIFICANT, "event list length = %d for %s %s", thelength, type, ref_num);
| + | |
| − | }
| + | |
| − | | + | |
| − | // Canceling all events from list
| + | |
| − | long index;
| + | |
| − | int i;
| + | |
| − | i=0;
| + | |
| − | for (i; i<thelength; i++) {
| + | |
| − | send_wait(0, atev_list, "dob_by_index", "DEFAULT", i, i);
| + | |
| − | if (msg_error()) {
| + | |
| − | logf(ERROR, "error getting dob_by_index for %s %s - %s", type, ref_num, msg[0]);
| + | |
| − | return;
| + | |
| − | }
| + | |
| − | object to_delete;
| + | |
| − | to_delete = msg[0];
| + | |
| − | send_wait(0, to_delete, "cancel_me");
| + | |
| − | if (msg_error()) {
| + | |
| − | logf(ERROR, "error deleting event %d for %s %s - %s", i, type, ref_num, msg[0]);
| + | |
| − | return;
| + | |
| − | } else {
| + | |
| − | logf(SIGNIFICANT, "successfully canceled event %d for %s %s", i, type, ref_num);
| + | |
| − | }
| + | |
| − | }
| + | |
| − | }</source>
| + | |
| − | | + | |
| − | | + | |
| − | <source lang="text">TABLE Spell_Macro
| + | |
| − | del description fragment lock_object ob_type sym type
| + | |
| − | usr_integer1 usr_integer2 usr_integer3 usr_string2 usr_string3 usr_string4
| + | |
| − |
| + | |
| − | { "0" ,"add an activty log listed in the event's \"Text Field\" to the change order",
| + | |
| − | "// add an activity log. Requires the macro be locked.\\0012int log_userid;\\0012log_userid = (uuid)"793ED69B4E87A545BD8E911834D829FC";\\0012 \\0012// get info from event to store in log description\\0012 \\0012string log;\\0012log = expand(event_tmpl.user_smag);\\0012 \\0012send_wait(0, this, \"log_event\", group_leader, log_userid, log);\\0012if (msg_error()) {\\0012 logf(ERROR, format(\"Macro event error '%s'\", msg[0]));\\0012}",
| + | |
| − | "0" ,"chg" ,"Add a Custom CHG Activity Log" ,"ACT",
| + | |
| − | "" ,"" ,"" ,"" ,"" ,"" }
| + | |
| − | { "0" ,"add an activty log listed in the event's \"Text Field\" to the request",
| + | |
| − | "// add an activity log. Requires the macro be locked.\\0012int log_userid;\\0012log_userid = (uuid)"793ED69B4E87A545BD8E911834D829FC";\\0012 \\0012// get info from event to store in log description\\0012 \\0012string log;\\0012log = expand(event_tmpl.user_smag);\\0012 \\0012send_wait(0, this, \"log_event\", group_leader, log_userid, log);\\0012if (msg_error()) {\\0012 logf(ERROR, format(\"Macro event error '%s'\", msg[0]));\\0012}",
| + | |
| − | "0" ,"cr" ,"Add a Custom Activity Log" ,"ACT",
| + | |
| − | "" ,"" ,"" ,"" ,"" ,"" }</source>
| + | |