Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hey, all! We're trying to complete a workflow task. When using it against a Routing-based workflow, no worries. When used against a Transition-based workflow, the task completes but doesn't move to the next workflow step. Workflow is still running. Code:
ReferenceFactory refFactory = new ReferenceFactory();
WTReference workitemref = refFactory.getReference(obidIn);
WorkItem curWorkItem = (WorkItem)workitemref.getObject();
WfAssignedActivity wfAssgAct = (WfAssignedActivity)curWorkItem.getSource().getObject();
ProcessData data = wfAssgAct.getContect();
WfVariable[] list = data.getVariableList();
String associagedOID = (String)list[1].getValueObject();
WTReference wtref = refFactory.getReference(associatedOID);
Object workable = wtref.getObject();
Vector results = new Vector();results.add("Complete");
wfAssgAct.complete(results);
Thoughts?
Figured it out.
curWorkItem.setComplete("Fast_Track"); | |||||
PersistenceHelper.manager.save(curWorkItem); | |||||
|
To follow up, the .setComplete("string") code sets an attribute for who approved it. So the code should call the current principal and put their username into that field.