AnsweredAssumed Answered

change in website submission workflow leads2exception denied

Question asked by ruchi3 on Sep 5, 2009
In my case I m using the default workflow submit_processdefinition (“web site submission workflow”), it works fine in the following scenario:



Creator Project(sand box) creates content submits to editor

Editor receives the content and as soon as he approves it, the content gets deployed(by Auto Deploy  ASR) to his web project.



BUT now:



!) if I add some logger statements in the submit_prcess definition file and restart the server, the logger messages are not shown though all the logger levels for js script nad workflow are set to debug and it shows the default loggers which are present in the submit_proce*
.xml file . Pls see the attached file for the logger statements:



logger.log("Ruchi3===="); this doesn’t get printed

logger.log("WCM Submit Process: Start submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")"); -à this gets printed



It means the changes are not deployed.





2) Now through jbpm console I undeploy the submit workflow and restart the server, now I can see the changes for logger file but when I try to execute the flow:



Creator Project(sand box) creates content submits to editor

Editor receives the content in his TO DO List but and as soon as he approves it, I get the following error and auto deploy to his sand box fails:





13:30:21,101 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource '_root

13:30:21,192 DEBUG [org.alfresco.repo.jscript.ScriptLogger] Ruchi2====

13:30:21,192 DEBUG [org.alfresco.repo.jscript.ScriptLogger] WCM Submit Process: Triggering submit for ruchiejustice11

13:30:21,192 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Time to execute script: 72.55782ms

13:30:21,271 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource '_root

13:30:21,294 DEBUG [org.alfresco.repo.jscript.ScriptLogger] Ruchi3====

13:30:21,294 DEBUG [org.alfresco.repo.jscript.ScriptLogger] WCM Submit Process: Start submit for ruchiejustice11 (by system)

13:30:21,294 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Time to execute script: 2.074565ms

13:30:30,019 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Imports resolved, adding resource '_root

13:30:30,019 DEBUG [org.alfresco.repo.jscript.ScriptLogger] Ruchi4====

13:30:30,019 DEBUG [org.alfresco.repo.jscript.ScriptLogger] WCM Submit Process: End submit for ruchiejustice11 (by system)

13:30:30,019 DEBUG [org.alfresco.repo.jscript.RhinoScriptProcessor] Time to execute script: 1.881245ms

13:30:30,633 ERROR [org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl] Failed to execute asynchronous action: Action[ id=4c8a3393-a9d3-4612-8324-25d908a30d30, node=null ]

org.alfresco.repo.security.permissions.AccessDeniedException: Access Denied.  You do not have the appropriate permissions to perform this operation.

            at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53)

            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

            at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)

            at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)

            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

            at $Proxy63.getProperties(Unknown Source)

            at org.alfresco.repo.avm.actions.AVMDeployWebsiteAction.executeImpl(AVMDeployWebsiteAction.java:271)

            at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:127)

            at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:688)

            at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:625)

            at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1$1.execute(AsynchronousActionExecutionQueueImpl.java:369)

            at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:322)

            at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:229)

            at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1.doWork(AsynchronousActionExecutionQueueImpl.java:378)

            at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:497)

            at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:381)

            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)

            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)

            at java.lang.Thread.run(Thread.java:595)

Caused by: net.sf.acegisecurity.AccessDeniedException: Access is denied.

            at net.sf.acegisecurity.vote.AffirmativeBased.decide(AffirmativeBased.java:86)

            at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:394)

            at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)

            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

            at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)

            … 21 more ]
My submit_processdefinition is
<?xml version="1.0" encoding="UTF-8"?>

<!– This describes a process for submitting changed content in a user –>
<!– sandbox, via an approver, to the staging sandbox. –>

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="wcmwf:submit">

    <swimlane name="initiator"/>

    <!–              –>
    <!– Start Review –>
    <!–              –>

    <start-state name="start">
        <task name="wcmwf:submitReviewTask" swimlane="initiator"/>
        <transition name="" to="initialise"/>
    </start-state>

    <decision name="initialise">
        <event type="node-enter">
            <script>
                <variable name="wcmwf_reviewCycle" access="write"/>
                <expression>
                   wcmwf_reviewCycle = 1;
                </expression>
            </script>
        </event>       
        <transition name="" to="serialorparallel" />
        <transition name="checklinks" to="checklinks">
           <condition>#{wcmwf_validateLinks != null &amp;&amp; wcmwf_validateLinks == true}</condition>
        </transition>
    </decision>
   
    <!–                                –>
    <!– Validate Links being submitted –>
    <!–                                –>
   
    <decision name="checklinks">
        <event type="node-enter">
            <action class="org.alfresco.repo.avm.wf.AVMSubmitLinkChecker" />
        </event>
        <transition name="brokenlinkspresent" to="verifybrokenlinks" />
        <transition name="nobrokenlinks" to="serialorparallel" >
            <condition>#{wcmwf_brokenLinks == 0}</condition>
        </transition>
    </decision>
   
    <task-node name="verifybrokenlinks">
        <task name="wcmwf:verifyBrokenLinksTask" swimlane="initiator" />
        <transition name="abort" to="end" />
        <transition name="continue" to="serialorparallel" />
    </task-node>

    <!–                                      –>
    <!– Split into Serial or Parallel Review –>
    <!–                                      –>

    <decision name="serialorparallel">
       <event type="node-enter">
            <script>
               <variable name="wcmwf_reviewerCnt" access="write"/>
               <variable name="wcmwf_approveCnt" access="write"/>
               <variable name="wcmwf_reviewType" access="write"/>
               <expression>
                  wcmwf_reviewerCnt = bpm_assignees.size();
                  wcmwf_approveCnt = 0;
                  wcmwf_reviewType = wcmwf_submitReviewType;
               </expression>
            </script>
       </event>

       <transition name="serial" to="submitserialreview" />
       <transition name="parallel" to="submitparallelreview">
          <condition>#{wcmwf_reviewType == "Parallel"}</condition>
       </transition>
    </decision>  


    <!–               –>
    <!– Serial Review –>
    <!–               –>

    <decision name="submitserialreview">
       <transition name="endreview" to="endreview" />
       <transition name="review" to="serialreview">
         <condition>#{wcmwf_approveCnt &lt; wcmwf_reviewerCnt}</condition>
       </transition>
    </decision>  

    <task-node name="serialreview">
        <task name="wcmwf:reviewTask">
           <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
              <actor>#{bpm_assignees.get(wcmwf_approveCnt)}</actor>
           </assignment>
           <event type="task-assign">
              <script>
                 if (wcmwf_reviewCycle > 1)
                    taskInstance.description = taskInstance.description + " (" + wcmwf_reviewCycle + ")";
              </script>
           </event>          
        </task>

        <transition name="approve" to="submitserialreview">
           <script>
              <variable name="wcmwf_approveCnt" access="read, write"/>
              <expression>
                 wcmwf_approveCnt = wcmwf_approveCnt + 1;
              </expression>
           </script>
        </transition>
        <transition name="reject" to="endreview" />
    </task-node>


    <!–                 –>
    <!– Parallel Review –>
    <!–                 –>

    <node name="submitparallelreview">
        <action class="org.alfresco.repo.workflow.jbpm.ForEachFork">
            <foreach>#{bpm_assignees}</foreach>
            <var>reviewer</var>
        </action>
        <transition name="review" to="parallelreview" />
    </node>

    <task-node name="parallelreview">
        <task name="wcmwf:parallelReviewTask">
           <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
              <actor>#{reviewer}</actor>
           </assignment>
           <event type="task-assign">
              <script>
                 if (wcmwf_reviewCycle > 1)
                    taskInstance.description = taskInstance.description + " (" + wcmwf_reviewCycle + ")";
              </script>
           </event>          
        </task>
        <transition name="approve" to="joinparallelreview">
            <script>
                <variable name="wcmwf_approveCnt" access="read,write" />
                <expression>
                    wcmwf_approveCnt = wcmwf_approveCnt +1;
                </expression>
            </script>
        </transition>
        <transition name="reject" to="joinparallelreview" />
    </task-node>

    <join name="joinparallelreview">
        <transition to="endreview" />
    </join>


    <!–                –>
    <!– End the Review –>
    <!–                –>

    <decision name="endreview">
       <transition name="rejected" to="rejected" />
       <transition name="approved" to="onapprove">
           <condition>#{wcmwf_approveCnt == wcmwf_reviewerCnt}</condition>
       </transition>
    </decision>  

    <task-node name="rejected">
        <task name="wcmwf:rejectedTask" swimlane="initiator" >
            <event type="task-assign">
                <script>
                    if (wcmwf_reviewCycle > 1)
                        taskInstance.description = taskInstance.description + " (" + wcmwf_reviewCycle + ")";
                </script>
            </event>
        </task>
        <transition name="abort" to="end" />
        <transition name="resubmit" to="serialorparallel">        <!– restart review process (next cycle) –>
           <script>
               <variable name="wcmwf_reviewCycle" access="read,write" />
               <expression>
                   wcmwf_reviewCycle = wcmwf_reviewCycle +1;
               </expression>
           </script>
        </transition>
    </task-node>

    <decision name="onapprove">
       <transition name="launchnow" to="submitted" />
       <transition name="launchpending" to="submitpending">
           <condition>#{wcmwf_launchDate != null}</condition>
       </transition>
    </decision>

    <task-node name="submitpending" end-tasks="true">
       <!– Updated by Lalit on July 12,2009 for Workflow customization.
       <task name="wcmwf:submitpendingTask" swimlane="initiator">–>
      <task name="wcmwf:submitpendingTask" swimlane="assignee">
           <event type="task-create">
              <script>
                 taskInstance.dueDate = wcmwf_launchDate;
              </script>
           </event>       
           <timer duedate="#{wcmwf_launchDate}" transition="launch" >
               <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                   <script>
               logger.log("Ruchi1====");
                      logger.log("WCM Submission " + bpm_workflowDescription + " submitted at " + wcmwf_launchDate + " by " + person.properties.userName);
                   </script>
               </action>
           </timer>
        </task>
        <transition name="cancel" to="submitcancelled" />
        <transition name="launch" to="submitted" />
    </task-node>

    <task-node name="submitcancelled">
        <task name="wcmwf:submitcancelledTask" swimlane="initiator" />
        <transition name="" to="end" />
    </task-node>

    <task-node name="submitted" end-tasks="true">
         <!– Updated by Lalit on July 12,2009 for Workflow customization.
       <task name="wcmwf:submittedTask" swimlane="initiator">–>
      <task name="wcmwf:submittedTask" swimlane="assignee">
            <timer duedate="5 seconds" transition="onsubmit">
                <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                    <script>
                logger.log("Ruchi2====");
                        logger.log("WCM Submit Process: Triggering submit for " + bpm_workflowDescription);
                    </script>
                </action>
            </timer>

           <event type="task-end">
                <script>
                   <variable name="submitfailed" access="write"/>
                   <expression>submitfailed = false;</expression>
                </script>
          
               <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                   <script>
                logger.log("Ruchi3====");
                       logger.log("WCM Submit Process: Start submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
                   </script>
               </action>
   
               <action class="org.alfresco.repo.avm.wf.AVMSubmitPackageHandler"/>
               <action class="org.alfresco.repo.avm.wf.AVMDeployHandler"/>
             
               <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                   <script>
            [b]    logger.log("Ruchi4====");[/b]                        logger.log("WCM Submit Process: End submit for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
                   </script>
               </action>
           </event>
        </task>
        <transition name="onsubmit" to="checkfailedsubmit">
         <exception-handler>
                <script>
               <variable name="submitfailed" access="write"/>
               <expression>
                [b]logger.log("Ruchi5====");[/b]                        logger.log("WCM Submit Process: Submit failed for " + bpm_workflowDescription + " (by " + person.properties.userName + ")");
                  submitfailed = true;
               </expression>
            </script>
         </exception-handler>
        </transition>
    </task-node>

    <decision name="checkfailedsubmit">
        <transition name="failure" to="submitfailed">
           <condition>#{submitfailed == true}</condition>
        </transition>
        <transition name="success" to="end">
           <condition>#{submitfailed == false}</condition>
        </transition>
    </decision>

    <task-node name="submitfailed">
        <task name="wcmwf:submitfailedTask" swimlane="initiator"/>
        <transition name="" to="end"/>
    </task-node>

    <!–                 –>
    <!– End the Process –>
    <!–                 –>

    <end-state name="end"/>
   
    <event type="process-end">
        <action class="org.alfresco.repo.avm.wf.AVMRemoveAllSrcWebappsHandler"/>
        <action class="org.alfresco.repo.avm.wf.AVMReleaseTestServerHandler"/>
        <action class="org.alfresco.repo.avm.wf.AVMRemoveWFStoreHandler"/>
    </event>

</process-definition>
see the loggers written in bold







The unnecessary user system comes into picture just by putting the logger statements. Why is it so???



Pls Help………Is it a bug or AM I doing something wrong





Thanks and Regards

Outcomes