AnsweredAssumed Answered

Workflow initiation by admin

Question asked by shivangi on Sep 29, 2008
Latest reply on Oct 14, 2008 by vinaxwater
I wish only admin should be able to initiate a workflow.

Kindly tell me how to achieve that ?

I tried following way in which after initiation during the first transition the intiator is checked if its a 'admin'.. which didnt worked for me  :(:(

<swimlane name="initiator"/>
   <start-state name="start">
        <task name="mywf:submitReviewTask" swimlane="initiator" >
       <event type="node-leave">
            <script>
         <variable name="mywf_StarterName" access="write"/>
                <expression>
                 mywf_StarterName = Authentication.getAuthenticatedActorId();
      </expression>
            </script>
        </event>
      </task>
        <transition name="" to="authorverification">
        <condition>#{mywf_StarterName == "admin"}</condition>
<!– <condition>#{people.getPerson(initiator).properties["cm:userName"] == "admin"}</condition> –>
<!–  <condition>#{person.properties.userName == "admin"}</condition>  –>
<!– <condition>#{Authentication.getAuthenticatedActorId() == "admin"}</condition> –>
   </transition>

Is this the right approach to restrict the users to initiate a workflow??

All the above conditions shows a error:  Caused by: org.jbpm.jpdl.JpdlException: [[ERROR] line 61: cvc-complex-type.2.4.a: Invalid content was found starting with element 'condition'. One of '{"urn:jbpm.org:jpdl-3.1":action, "urn:jbpm.org:jpdl-3.1":script, "urn:jbpm.org:jpdl-3.1":create-timer, "urn:jbpm.org:jpdl-3.1":cancel-timer, "urn:jbpm.org:jpdl-3.1":exception-handler}' is expected.,
</start-state>

Outcomes