AnsweredAssumed Answered

Add space to Bpm_Package

Question asked by 7joeblack8 on Jul 23, 2013
Latest reply on Jul 23, 2013 by 7joeblack8
hi there,

i'm searching for a way to add a space to a bpm_package (i put, as u can see, the underscore…it's not causal).

my attempt works well with simple files…:

<javascript><userTask id="alfrescoUsertask1" name="Compiler" activiti:assignee="costantino" activiti:formKey="wf:reviewTasknew">
      <extensionElements>
       <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
               <activiti:field name="runAs">
                  <activiti:string>admin</activiti:string>
               </activiti:field>
                  <activiti:field name="script">
               
                     <activiti:string>   
         var dest = companyhome.childByNamePath("Demo");
         var file = dest.createFile(task.getVariable('cmis_name') +".txt");
         file.content="Importo Mutuo: " + task.getVariable('wf_importvalue');
         file.save();
         var trans1 = file.transformDocument("application/pdf");
         bpm_package.addNode(trans1);
         file.remove();
         var new_doc = companyhome.childByNamePath("/test.pdf");
            
         if (new_doc != null) {
              bpm_package.addNode(new_doc);  
         }
      
                     </activiti:string>
                  </activiti:field>
                </activiti:taskListener>
       </extensionElements>
   </userTask>
</javascript>


if i try to add a folder node to bpm_package it works…but if i click:

<javascript>java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at com.wewebu.ow.server.ui.OwAppContext.handleRequest(OwAppContext.java:1129)
   at com.wewebu.ow.server.app.OwMainAppContext.handleRequest(OwMainAppContext.java:655)
   at com.wewebu.ow.server.ui.OwWebApplication.handleRequest(OwWebApplication.java:358)
   at org.apache.jsp.default41_jsp._jspService(default41_jsp.java:71)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
   at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
   at com.wewebu.ow.server.servlets.OwServletFilter.doFilter(OwServletFilter.java:57)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
   at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
   at java.lang.Thread.run(Thread.java:722)
Caused by: com.wewebu.ow.server.exceptions.OwServerException: Parent feed is empty!
   at com.wewebu.ow.server.ecmimpl.opencmis.aspects.OwCMISExceptionManagement.ajc$afterThrowing$com_wewebu_ow_server_ecmimpl_opencmis_aspects_OwCMISExceptionManagement$1$74b69fe1(OwCMISExceptionManagement.aj:81)
   at com.wewebu.ow.server.ecmimpl.opencmis.object.OwCMISFolderObject.getParents(OwCMISFolderObject.java:354)
   at com.wewebu.ow.server.app.OwEcmUtil.iterateParentPathOfClass(OwEcmUtil.java:434)
   at com.wewebu.ow.server.app.OwEcmUtil.iterateParentPathOfClass(OwEcmUtil.java:474)
   at com.wewebu.ow.server.app.OwEcmUtil.iterateParentPathOfClass(OwEcmUtil.java:474)
   at com.wewebu.ow.server.app.OwEcmUtil.getParentPathOfClass(OwEcmUtil.java:418)
   at com.wewebu.ow.server.app.OwMimeManager.delegateToMasterPlugin(OwMimeManager.java:1074)
   at com.wewebu.ow.server.app.OwMimeManager.onPluginEventHandler(OwMimeManager.java:1045)
   … 30 more
Caused by: org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Parent feed is empty!
   at org.apache.chemistry.opencmis.client.bindings.spi.atompub.NavigationServiceImpl.getFolderParent(NavigationServiceImpl.java:196)
   at org.apache.chemistry.opencmis.client.runtime.FolderImpl.getParents(FolderImpl.java:411)
   at org.apache.chemistry.opencmis.client.runtime.AbstractFilableCmisObject.getParents(AbstractFilableCmisObject.java:49)
   at org.apache.chemistry.opencmis.client.runtime.AbstractTransientFileableCmisObject.getParents(AbstractTransientFileableCmisObject.java:36)
   at com.wewebu.ow.server.ecmimpl.opencmis.object.OwCMISFolderObject.getParents(OwCMISFolderObject.java:348)
</javascript>

i search related discussions…but didn't find a proper answer.

Goal: click folder fires e-File plugin…

thanks!

Outcomes