Bryanjscott777 - Monday, December 7, 2015 3:40 PM:
Normal 0 false false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
I have a situation where coming off of a “Training” task (see below, hope picture shows up), I have an over-ride path (CM Training Update). The problem is that I do not want anyone in the training group to be able to select this path, I want to limit the training group to using the “Refuse” option which will send a notification to me (CM) with the question allowing me to investigate and respond using “Delegate” back to the trainee(s) without disrupting the voting of everyone else. If investigation does require an update, I want only “CM” to be able to initiate the “CM Training Update” path which will remove the training task from the balance of the training group which has not voted.
string u = this.getProperty("created_by_id","");
if (u != "62AD9C55AA4B4FDAB0212BB03B46D469") {
return inn.newError("Insufficient Privileges to Vote CM Training Update, Please Vote Refuse");
}
return this;
Harsha - Monday, December 14, 2015 9:47 AM:
Hi,
In the above method 'this' refers to Activity item, not the item for which you are doing vote. Please see the below example to get the actual item from the Activity item:
Innovator inn = this.getInnovator();
Item _item = inn.newItem("Part","get");
_item.setProperty("select","id");
Item wfItem = inn.newItem("Workflow","get");
wfItem.setAttribute("select","id");
string actID = this.getID();
Item wflProc = inn.newItem("Workflow Process","get");
wflProc.setAttribute("select","id");
Item wflAct = inn.newItem("Workflow Process Activity","get") ;
wflAct.setProperty("related_id",actID) ;
wflAct.setAttribute("select","id");
wflProc.addRelationship(wflAct);
wfItem.setRelatedItem(wflProc);
_item.addRelationship(wfItem);
_item = _item.apply();
string createdById = _item.getProperty("created_by_id");
This is not tested, just an example.
Thank you,
Harsha
Bryanjscott777 - Friday, January 8, 2016 11:30 AM:
Hi Harsha,
Thank you for taking the time to respond, I am working on massaging your example into a working method, but due to my lack of programming skills, this may take some time.
I think that I understand the process that you have laid out to identify the Activity Item, but still need to figure out how to get it to point specifically to the "CM Training Update" path or the workflow, it would seem that I need to add some specifics into your example.
I will post an update when I have this working, thanks again for the response, this will save me a good deal of grief when it's working.
Bryan