How to update a Workspace in Server side deliver advisor
Hi,
In a server side Deliver Advisor I wish to change the default flow target of the source workspace. I have code as follows:
IWorkspace workingWorkspace = (IWorkspace)workspace.getWorkingCopy();
CurrentFlows flows = ((Workspace) workingWorkspace).getCurrentFlows();
flows.setDefaultAcceptFlow(shipUUID);
flows.setDefaultDeliverFlow(shipUUID);
((Workspace) workingWorkspace).setCurrentFlows(flows);
However, the update seems not to persist, I tried calling IRepositoryItemService.saveItem, but that results in an Access Violation.
How do I save the working copy of the workspace? I'm sure there must be a method somewhere, but I can't spot it.
Regards..
|
One answer
Making changes to items is not permitted in advisor code, that is why the transaction is being rolled back. Advisors are meant to validate the changes are either reject the delivery or allow it to proceed.
I hope that this helps, Chris Comments
Ian Hodges
commented Oct 22 '15, 6:54 a.m.
Thanks Chris, good point I had overlooked that.
Hi Ian,
sam detweiler
commented Oct 22 '15, 10:49 a.m.
well, if the participant service class is created as an extension like this
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
As Chris mentions, any changes must be done in a Participant plugin. Note that the original transaction has been committed before the participant is called. The participant could cause another transaction, but cannot modify the original