Friends,I am removing my site in alfresco share (alfresco 3.2r) using my workflow process-definition file on reject action :
<task-node name="approved">
<event type="node-enter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
if(bpm_package.children[0].parent.parent.properties["stcp:siteStatus"])
{
bpm_package.children[0].parent.parent.properties["stcp:siteStatus"] = "Approved";
bpm_package.children[0].parent.parent.save();
[b]bpm_package.children[0].remove();[/b]
}
</script>
</action>
</event>
<transition name="" to="end" />
</task-node>
Using above code, site is removed successfully. from DM also. I have checkd node Browser also.when I create same name site again, it will throw me error :
04210043 Failed to execute script '/org/alfresco/repository/site/sites.post.json.js (in classpath store file:C:/alfresco/tomcat/shared/classes/alfresco/extension/templates/webscripts)': Duplicate child name not allowed: f14af2e1-6565-4b6f-8262-2d831cb8ee69
I have changed sites.post.json.js little to following
var jsonStr = eval('(' + json + ')');
/*custom create site, for custom props */
var site = siteService.createSite(sitePreset, shortName, title, description, visibility,jsonStr);
let me know.. what wrong I am doing over here….???