2012-02-01 138 views
2

我已經創建了自己的自定義工作流程(現在這只是adhoc工作流程定製),並且我已經設法自定義啓動工作流程表單,但無法定製第二個表單,這是編輯任務表單用戶啓動進程並分配給「某人」,「某人」在收件箱中獲取任務,並且他看到編輯任務表單)。第二種形式與我的第一種形式相同,並加上一些額外的字段。這是因爲我需要「某人」可以查看和編輯在啓動工作流表單上輸入的數據。所以我基本上覆制第一種形式的配置到第二種形式,但這不起作用,只渲​​染集和textareas。現在有人如何定製這個?編輯任務工作流程FORM change

工作流定義

<process id="appppV1" name="Proces otvaranja projekta"> 

<startEvent id="start" name="Start" activiti:formKey="mcwm:submitStart"></startEvent> 

<userTask id="preparationOfProjectCharter" name="Priprema projektne povelje" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="mcwm:preparationOfProjectCharter"> 
    <extensionElements> 
    <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"> 
     <activiti:field name="script"> 
     <activiti:string>if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);</activiti:string> 
     </activiti:field> 
    </activiti:taskListener> 
    </extensionElements> 
</userTask> 

模型的工作流程:

<types> 
    <type name="mcwm:submitStart"> 
     <parent>bpm:startTask</parent> 
     <properties> 
      <property name="mcwm:projectName"> 
       <title>Naziv projekta</title> 
       <type>d:text</type> 
       <mandatory>true</mandatory> 
      </property> 
      <property name="mcwm:shortProjectName"> 
       <title>Skraćeni naziv projekta</title> 
       <type>d:text</type> 
       <mandatory>false</mandatory> 
      </property> 
      <property name="mcwm:projectOrderer"> 
       <title>Naručitelj projekta</title> 
       <type>d:text</type> 
       <mandatory>false</mandatory> 
      </property> 
      <property name="mcwm:shortProjectOrderer"> 
       <title>Skraćeni naziv naručitelja projekta</title> 
       <type>d:text</type> 
       <mandatory>false</mandatory> 
      </property> 
      <property name="mcwm:isoProcess"> 
       <title>ISO 9000 proces</title> 
       <type>d:text</type> 
       <mandatory>true</mandatory> 
       <default> </default> 
       <constraints> 
        <constraint name="mcwm:isoProcessChoices" type="LIST"> 
         <parameter name="allowedValues"> 
          <list> 
           <value> </value> 
           <value>održavanje - aplikativno</value> 
           <value>održavanje - sistemsko</value> 
           <value>konsalting</value> 
           <value>razvoj - sa odobrenjem arhitekture</value> 
           <value>razvoj - bez odobrenjem arhitekture</value> 
           <value>mali razvoj</value> 
           <value>implementacija</value> 
          </list> 
         </parameter> 
        </constraint> 
       </constraints> 
      </property> 
      <property name="mcwm:reporting"> 
       <title>Učestalost izveštavanja</title> 
       <type>d:text</type> 
       <mandatory>true</mandatory> 
       <default>mesečno</default> 
       <constraints> 
        <constraint name="mcwm:reportingChoices" type="LIST"> 
         <parameter name="allowedValues"> 
          <list> 
           <value>mesečno</value> 
           <value>kvartalno</value> 
           <value>po okončanju</value> 
          </list> 
         </parameter> 
        </constraint> 
       </constraints> 
      </property> 
      <property name="mcwm:projectGoals"> 
       <title>Ciljevi projekta</title> 
       <type>d:text</type> 
       <mandatory>false</mandatory> 
      </property> 

      <property name="mcwm:beginDate"> 
       <title>Datum početka projekta</title> 
       <type>d:date</type> 
       <mandatory>true</mandatory> 
      </property> 

      <property name="mcwm:endDate"> 
       <title>Datum okončanja projekta</title> 
       <type>d:date</type> 
       <mandatory>false</mandatory> 
      </property> 

      <property name="mcwm:team"> 
       <title>Projektni tim (*promena tipa kontorle)</title> 
       <type>d:text</type> 
       <mandatory>false</mandatory> 
      </property> 

      <property name="mcwm:teamResource"> 
       <title>Predviđeni utrošak ljudskih resursa (*promena tipa kontorle)</title> 
       <type>d:text</type> 
       <mandatory>false</mandatory> 
      </property> 

      <property name="mcwm:teamComent"> 
       <title>Komentar na predviđeni utrošak ljudskih resursa</title> 
       <type>d:text</type> 
       <mandatory>false</mandatory> 
      </property> 

      <property name="mcwm:changeComent"> 
       <title>Komentar izmene</title> 
       <type>d:text</type> 
       <mandatory>false</mandatory> 
      </property> 
     </properties> 
    <!-- To select a user --> 
    <mandatory-aspects> 
     <aspect>bpm:assignee</aspect> 
    </mandatory-aspects> 
    </type> 

    <type name="mcwm:preparationOfProjectCharter"> 
     <parent>bpm:workflowTask</parent> 
     <properties> 
      <property name="mcwm:editTask"> 
       <title>Edit task</title> 
       <type>d:text</type> 
       <mandatory>true</mandatory> 
      </property> 
     </properties> 
    </type> 

共享配置,custom.xml

<config evaluator="string-compare" condition="activiti$appppV1"> 
    <forms> 
    <form> 
     <field-visibility> 
      <hide id="bpm:workflowDescription" /> 
      <hide id="bpm:workflowDueDate" /> 
      <hide id="bpm:workflowPriority" /> 
      <show id="bpm:assignee" /> 

      <show id="mcwm:projectName" /> 
      <show id="mcwm:shortProjectName" /> 
      <show id="mcwm:projectOrderer" /> 
      <show id="mcwm:shortProjectOrderer" /> 
      <show id="mcwm:isoProcess" /> 
      <show id="mcwm:reporting"/> 
      <show id="mcwm:projectGoals"/> 
      <show id="mcwm:beginDate"/> 
      <show id="mcwm:endDate"/> 

      <show id="mcwm:team"/> 
      <show id="mcwm:teamResource"/> 
      <show id="mcwm:teamComent"/> 
      <show id="mcwm:changeComent"/> 


      <hide id="packageItems" /> 
      <hide id="bpm:sendEMailNotifications" /> 
     </field-visibility> 
     <appearance> 
      <set id="" appearance="title" label-id="apppv1.set.projekat" /> 
      <set id="general" appearance="fieldset" label-id="appppV1.set.general" /> 
      <set id="date" template="/org/alfresco/components/form/2-column-set.ftl" appearance="fieldset" label-id="appppV1.set.date" /> 
      <set id="team" appearance="fieldset" label-id="appppV1.set.team" /> 
      <set id="change" appearance="fieldset" label-id="appppV1.set.change" /> 


      <field id="mcwm:projectName" set="general" /> 
      <field id="mcwm:shortProjectName" set="general" /> 
      <field id="mcwm:projectOrderer" set="general" /> 
      <field id="mcwm:shortProjectOrderer" set="general" /> 
      <field id="mcwm:isoProcess" set="general" /> 
      <field id="mcwm:reporting" set="general" /> 

      <field id="mcwm:projectGoals" set="general"> 
       <control template="/org/alfresco/components/form/controls/textarea.ftl"> 
        <control-param name="style">width: 65%</control-param> 
        <control-param name="rows">5</control-param> 
       </control> 
      </field> 

      <field id="mcwm:beginDate" set="date"/> 
      <field id="mcwm:endDate" set="date"/> 
      <field id="bpm:assignee" set="team" label="Voditelj projekta"/> 
      <field id="mcwm:team" set="team"> 
       <control template="/org/alfresco/components/form/controls/textarea.ftl"> 
        <control-param name="style">width: 65%</control-param> 
        <control-param name="rows">5</control-param> 
       </control> 
      </field> 
      <field id="mcwm:teamResource" set="team"/> 
      <field id="mcwm:teamComent" set="team"> 
       <control template="/org/alfresco/components/form/controls/textarea.ftl"> 
        <control-param name="style">width: 65%</control-param> 
        <control-param name="rows">5</control-param> 
       </control> 
      </field> 

      <field id="mcwm:changeComent" set="change"> 
       <control template="/org/alfresco/components/form/controls/textarea.ftl"> 
        <control-param name="style">width: 65%</control-param> 
        <control-param name="rows">5</control-param> 
       </control> 
      </field> 
     </appearance> 
    </form> 
    </forms> 

股票CONFI G-custom.xml - 第二種形式

<config evaluator="task-type" condition="mcwm:preparationOfProjectCharter"> 
    <forms> 
     <form> 
      <field-visibility> 
       <show id="mcwm:projectName"/> 
       <show id="mcwm:editTask"/> 
       <hide id="bpm:workflowDescription" /> 
       <hide id="bpm:workflowDueDate" /> 
       <hide id="bpm:workflowPriority" /> 
       <show id="bpm:assignee" /> 

       <show id="mcwm:projectName" /> 
       <show id="mcwm:shortProjectName" /> 
       <show id="mcwm:projectOrderer" /> 
       <show id="mcwm:shortProjectOrderer" /> 
       <show id="mcwm:isoProcess" /> 
       <show id="mcwm:reporting"/> 
       <show id="mcwm:projectGoals"/> 
       <show id="mcwm:beginDate"/> 
       <show id="mcwm:endDate"/> 

       <show id="mcwm:team"/> 
       <show id="mcwm:teamResource"/> 
       <show id="mcwm:teamComent"/> 
       <show id="mcwm:changeComent"/> 
      </field-visibility> 
      <appearance> 
       <set id="" appearance="title" label-id="apppv1.set.projekat" /> 
       <set id="general" appearance="fieldset" label-id="appppV1.set.general" /> 
       <set id="date" template="/org/alfresco/components/form/2-column-set.ftl" appearance="fieldset" label-id="appppV1.set.date" /> 
       <set id="team" appearance="fieldset" label-id="appppV1.set.team" /> 
       <set id="change" appearance="fieldset" label-id="appppV1.set.change" /> 


       <field id="mcwm:projectName" set="general" /> 
       <field id="mcwm:shortProjectName" set="general" /> 
       <field id="mcwm:projectOrderer" set="general" /> 
       <field id="mcwm:shortProjectOrderer" set="general" /> 
       <field id="mcwm:isoProcess" set="general" /> 
       <field id="mcwm:reporting" set="general" /> 

       <field id="mcwm:projectGoals" set="general"> 
        <control template="/org/alfresco/components/form/controls/textarea.ftl"> 
         <control-param name="style">width: 65%</control-param> 
         <control-param name="rows">5</control-param> 
        </control> 
       </field> 

       <field id="mcwm:beginDate" set="date"/> 
       <field id="mcwm:endDate" set="date"/> 
       <field id="bpm:assignee" set="team" label="Voditelj projekta"/> 
       <field id="mcwm:team" set="team"> 
        <control template="/org/alfresco/components/form/controls/textarea.ftl"> 
         <control-param name="style">width: 65%</control-param> 
         <control-param name="rows">5</control-param> 
        </control> 
       </field> 
       <field id="mcwm:teamResource" set="team"/> 
       <field id="mcwm:teamComent" set="team"> 
        <control template="/org/alfresco/components/form/controls/textarea.ftl"> 
         <control-param name="style">width: 65%</control-param> 
         <control-param name="rows">5</control-param> 
        </control> 
       </field> 

       <field id="mcwm:changeComent" set="change"> 
        <control template="/org/alfresco/components/form/controls/textarea.ftl"> 
         <control-param name="style">width: 65%</control-param> 
         <control-param name="rows">5</control-param> 
        </control> 
       </field> 
       <field id="mcwm:editTask" set="general" read-only="true"/> 
      </appearance> 
     </form> 
    </forms> 

我嘗試在節目標籤使用以武力=「true」屬性,這表明我的申請,但數據不會從從我做起轉移?

在此先感謝您的幫助。

問候, 亞歷山大

回答

2

我認爲你沒有看到任何字段,因爲mcwm:preparationOfProjectCharter任務沒有屬性,你試圖顯示。

如果您需要在第一個任務上完成的第二個任務中具有相同的屬性,則必須在您的任務模型中定義它們。

如果屬性完全相同並且重複很多,則可以將它們指定爲一個方面,並將它們作爲強制方面添加到任務模型中。

+0

嗨,我一次。 :)我上面描述的解決方案工作,但必須明確地把任務屬性放在進程上,這些屬性是完全一樣的,並重復(每個任務在過程中有他們),所以我決定定義自定義方面,並將它們添加爲強制描述。沒關係,只有一個小問題。在我的方面,我有三個屬性,都是強制性的。在我的第二個任務,我添加該方面,我想設置方面屬性強制爲false,我使用覆蓋屬性標記,但這是不正常的,這是可能的嗎? – Aleksandar 2012-02-08 09:44:03

+0

你在哪裏使用覆蓋標籤? – 2012-02-09 07:02:04

+0

在我的第二個任務的模型中。我在第一個和第二個任務中增加了強制性的方面。默認情況下,方面的屬性被設置爲強制性的,這對我的第一個任務是可以的,但是我想要第二個任務將這些屬性設置爲mandatory = false。我的第二個任務模型 使用<屬性名=「mcwm:項目名稱」> 但這並沒有影響。 – Aleksandar 2012-02-09 08:58:57

1

感謝您的幫助。 :)我做了一些非常相似的事情。我只是設置我的第二個任務是父母的首要任務

<type name="mcwm:preparationOfProjectCharter"> 
<parent>mcwm:submitStart</parent> 

,現在我已經從第一任務,我的第二個任務中的所有財產。

問候,

亞歷山大

+0

哦,這樣的作品?你正在使用哪個版本? – 2012-02-03 11:31:51

+0

現在爲我工作:)。我正在使用Alfresco企業版4.0。 – Aleksandar 2012-02-03 13:11:40