cancel
Showing results for 
Search instead for 
Did you mean: 

access to the model

anusk
Champ in-the-making
Champ in-the-making
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!
4 REPLIES 4

zaizi
Champ in-the-making
Champ in-the-making
Try this;


            <script>
            <variable name="ag_name_group_reviwer" access="write" />
            <expression>
            logger.log("node event fired");
            ag_name_group_reviwer = "Approvers";  
            </expression>
           </script>

For some weird reason the last line of the <expression> is assigned to the variable.

sebp
Champ in-the-making
Champ in-the-making
Hi,
I have the same problem as anusk. I want that two predifined users appear as Workflow Assignees in the start task of my workflow. Zaizis' solution doesn't work (at least for me). I think this is because the start task is created after the Start Workflow dialog has finished. Am I right?

anusk
Champ in-the-making
Champ in-the-making
Sorry for the late reply, but I've been ill.
I tried the Zaizia's solution, but with no luck again.
Sebp, i think you're right because in all cases (task-start, task-create and node-enter events ) the log info appears in the console just after clicking the finished button of the workflow.
So, i'm still stuck…any ideas?

sethatrothbury
Champ in-the-making
Champ in-the-making
Why don't you set the default value of that property to the group you want?

            <property name="ag:name_group_reviewer">
                <type>d:text</type>
                <default>GROUP_reviewers</default>
                <mandatory>false</mandatory>
            </property>