It's all about the answers!

Ask a question

How to get Process Template source


1
1
Michele Pegoraro (1.8k14119103) | asked Jan 26 '11, 6:07 a.m.
Hi,
id like to get process template source code using client API in order to versioning it.

With process definition catched by Project Area this code work properly:


IProcessItemService itemClient = (IProcessItemService)repo.getClientLibrary(IProcessItemService.class);
IWorkingCopyManager workingCopyManager = itemClient.getWorkingCopyManager();
[...]
IProjectAreaWorkingCopy projAreaCopy = (IProjectAreaWorkingCopy) workingCopyManager.createPrivateWorkingCopy(projArea);
IDocument doc = projAreaCopy.getProcessSpecification();
String configStr = doc.get();


but if I use the same code on a IProcessDefinition object instead of IProjectArea I get that IProcessDefinitionWorkingCopy returned is null:

IProcessDefinitionWorkingCopy processDefWC = (IProcessDefinitionWorkingCopy)workingCopyManager.getWorkingCopy(processDef);

IDocument doc = processDefWC.getProcessSpecification();
String newProcessConf = doc.get();


The IProcessDefinition object was obtained using findAllProcessDefinitions on IProcessItemService.

Have someone any idea of why it returns a null value?
Thanks,
Michele.

2 answers



permanent link
Unknown User (2111) | answered Apr 24 '12, 12:41 p.m.
use workingCopyManager.createPrivateWorkingCopy and not GetWorkingCopy :D

permanent link
Michele Pegoraro (1.8k14119103) | answered Apr 26 '12, 3:36 a.m.
use workingCopyManager.createPrivateWorkingCopy and not GetWorkingCopy :D


Thanks for the answer. I've already tried it and it works.

Best regards,
Michele.

Your answer


Register or to post 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.