cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow initiation by admin

shivangi
Champ in-the-making
Champ in-the-making
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  Smiley SadSmiley Sad

<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>
4 REPLIES 4

vinaxwater
Champ in-the-making
Champ in-the-making
I think! Permision is not catch in definition process. You cant catch this with case 'user admin cant see list workflow and other user is not'. That is my idea!  :roll:

shivangi
Champ in-the-making
Champ in-the-making
Is there any way in which only admin be able to view admin workflows.? no other user can see that workflow?

In the above case all can view the workflow but only admin can initiate. This is not what we actually require.

hiteshlad
Champ in-the-making
Champ in-the-making
We're trying to do that too.

I have added the following to my web-client-config-wcm.xml:

<workflows>
        spwf:standardreview, spwf:expeditedpublish
</workflows>
<admin-workflows>
        wcmwf:changerequest, spwf:nopublish
</admin-workflows>

Unfortunately for me, it only shows up if i put it in the workflows sections, not in the admin-workflows secton.  Anyone else see this?

FYI, i am on alfresco 2.1.1

- hitesh

vinaxwater
Champ in-the-making
Champ in-the-making
This is problem can see in file StartWorkflowWizard:

package org.alfresco.web.bean.workflow;

with method:
getStartableWorkflows()

below is param code for check User logining:
// vinaxwater get user loging
      FacesContext context = FacesContext.getCurrentInstance();
      User user = Application.getCurrentUser(context);
      String userName = user.getUserName();

and this is solution:
user.isAdmin() >>> result return true if user logining is admin

method getStartableWorkflows() will return list workflows. Therefore, You can do work in this method.

Thanks and Regards.