cancel
Showing results for 
Search instead for 
Did you mean: 

set parameter association for workflow

xmlxml
Champ in-the-making
Champ in-the-making
I have:
Task model:


<type name="mytaskmodel:mytask">
         <parent>bpm:workflowTask</parent>
         <properties>
            <property name="mytaskmodel:pro_title">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>mytaskmodel:aspect_file_relate</aspect>
         </mandatory-aspects>
      </type>
   <aspects>
      <aspect name="mytaskmodel:aspect_file_relate">
         <associations>
               <association name="mytaskmodel:file_relate">
                        <title>File Relate</title>
                        <source>
                           <mandatory>false</mandatory>
                           <many>false</many>
                        </source>
                        <target>
                           <class>cm:content</class>
                           <mandatory>false</mandatory>
                           <many>true</many>
                        </target>
                     </association>
               </associations>
         </aspect>
   </aspects>



- Workflow id: activiti$myworkflow
- javascript code execute workflow:
     

        var wfdef = workflow.getDefinitionByName("activiti$myworkflow");   
   var wfparams=Array();
   wfparams["mytaskmodel:pro_title"]="Title";  
   var wfpackage = workflow.createPackage();
   var wfpath = wfdef.startWorkflow(wfpackage, wfparams);
     

- <b>My proplem: I want to set association wfparams["mytaskmodel:file_relate"] for workflow </b>.
   Associations node:
   +nodeRef1 workspace: "workspace://SpacesStore/2b1f9ce5-80c1-45e2-8f51-b782adda88b3"
   + nodeRef2 workspace: "workspace://SpacesStore/2b1f9ce5-80c1-45e2-8f51-d76eac78a88"
 
Please help me!
2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator
you can call alfresco javascript api in workflow javascript code ,
for example

companyhome.childByNamePath("/Data Dictionary/Presentation Templates/***");
companyHome.findNode(nodeRef)
<code>
or using java script search api
<code>
search.luceneSearch
search.findNode

xmlxml
Champ in-the-making
Champ in-the-making
Thank kaynezhang for replay!
I can findNode with nodeRef, my problem is create  association wfparams["mytaskmodel:file_relate"]=? with node1 and node2