this
is the Activity that is being voted on, not the work item of the workflow. To get the work item, you can use code like below to look up the item attached to the Workflow being voted on.
Innovator inn = this.getInnovator();
// In order to get the item this workflow is attached to, we first need to get the workflow
Item parentWorkflow = inn.newItem("Workflow", "get");
parentWorkflow.setAttribute("select", "source_id,source_type");
Item workflowProcess = parentWorkflow.createRelatedItem("Workflow Process", "get");
Item workflowProcessActivity = workflowProcess.createRelationship("Workflow Process Activity", "get");
workflowProcessActivity.setProperty("related_id", this.getID());
parentWorkflow = parentWorkflow.apply();
// Now get the Item that this workflow is attached to
string sourceITName = parentWorkflow.getPropertyAttribute("source_type", "keyed_name", "");
Item workItem = inn.newItem(sourceITName, "get");
workItem.setAttribute("id", parentWorkflow.getProperty("source_id", ""));
workItem = workItem.apply();
Chris
this
is the Activity that is being voted on, not the work item of the workflow. To get the work item, you can use code like below to look up the item attached to the Workflow being voted on.
Innovator inn = this.getInnovator();
// In order to get the item this workflow is attached to, we first need to get the workflow
Item parentWorkflow = inn.newItem("Workflow", "get");
parentWorkflow.setAttribute("select", "source_id,source_type");
Item workflowProcess = parentWorkflow.createRelatedItem("Workflow Process", "get");
Item workflowProcessActivity = workflowProcess.createRelationship("Workflow Process Activity", "get");
workflowProcessActivity.setProperty("related_id", this.getID());
parentWorkflow = parentWorkflow.apply();
// Now get the Item that this workflow is attached to
string sourceITName = parentWorkflow.getPropertyAttribute("source_type", "keyed_name", "");
Item workItem = inn.newItem(sourceITName, "get");
workItem.setAttribute("id", parentWorkflow.getProperty("source_id", ""));
workItem = workItem.apply();
Chris