AnsweredAssumed Answered

access to the model

Question asked by anusk on May 10, 2010
Latest reply on May 19, 2010 by sethatrothbury
I'm having troubles implementing advanced workflows. I did a workflow which directly assign
the task "review" to a predefined group, and I would like  when the screen "Workflow options"
appears , it shows the name of the group that handle the task.
The problem is I can’t achieve that, Alfresco always read the script after that screen, and the text field is empty.
I tried with the “task-create” and “task-start” events, but with the same result, so is there any way to access the model.xml from the processdefinition.xml before the screen of workflows options shows up?

And another question, is possible to set the swimlane “initiator” to be the owner of a document, and if other person goes to the “Start Workflow Advanced” in that document Alfresco won’t give the possibility of choosing that workflow? How can I achieve that behavior?

Here is my code
model
<type name="ag:submit_workflow_task">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="ag:name_group_reviewer">
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
         </properties>
         <overrides>
            <property name="bpm:packageItemActionGroup">
                    <default>start_package_item_actions</default>
                </property>
         </overrides>
      </type>

processdefinition
<start-state name="start">
   <event type="node-enter">
         <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
            <script>
            <variable name="ag_name_group_reviwer" access="read,write" />
            <expression>
            logger.log("node event fired"); 
            ag_name_group_reviwer = "Approvers";
            logger.log("Grupo: "+ag_name_group_reviwer);  
            </expression></script>
         </action>
      </event>
      <task name="ag:submit_workflow_task" swimlane="initiator"></task>
      <transition name="" to="review"></transition>
      </start-state>


Thanks in advanced!

Outcomes