AnsweredAssumed Answered

Adding new content type to alfresco workflow

Question asked by konart on Jun 19, 2014
Latest reply on Jun 24, 2014 by jpotts
What I'm trying to do is to have a select element on workflow start form with a list of companies. Depending on a chosen company name workflow engine should choose what to do next (choose next step).

I'm still quite lost about how this whole thing works actually (too complicated for me I guess) and this is what I have tried at the moment:

First, I create a new model company.xml:

    <?xml version="1.0" encoding="UTF-8"?>

    <model name="itn:company" xmlns="http://www.alfresco.org/model/dictionary/1.0">

        <description>Company model</description>
        <author>konart</author>
        <version>1.0</version>

        <imports>
            <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"></import>
            <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"></import>
        </imports> 

        <namespaces>
            <namespace uri="http://www.iteranet.ru/model/content/1.0" prefix="itn" />
        </namespaces>
    </model>
   
    <types>
        <type name="itn:Company">

            <title>Компания</title>

            <parent>cm:content</parent>        
            <properties>
                <property name="itn:Name">
                    <title>Название</title>

                    <type>d:text</type>

                    <protected>false</protected>

                    <mandatory>true</mandatory>

                    <multiple>false</multiple>

                    <default>Итеранет</default>
                </property>
            </properties>
           
            <constraints>
               <constraint name="itn:Name" type="LIST">
                    <parameter name="AllowedValues">
                        <list>
                            <value>Итеранет</value>
                            <value>СофтЭра</value>
                        </list>
                    </parameter>
                </constraint> 
            </constraints>
   
        </type>
    </types>


Next, I add this model  to my workflow's -context file:

    <property name="models">
            <list>
                <value>alfresco/extension/model/DirectiveWorkflowModel.xml</value>
                <value>alfresco/extension/company.xml</value>
            </list>
    </property>


Then, I add it to the web-client-config-custom.xml:

    <alfresco-config>
    
       <config evaluator="string-compare" condition="Languages">
          <languages>
             <language locale="ru_RU">Russian</language>
          </languages>
       </config>

       <config evaluator="node-type" condition="dir:start" replace="true">
          <property-sheet>

          <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
   
          <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
          <show-property name="itn:Company" />

          <show-association name="bpm:assignee" />
          </property-sheet>
       </config>
    </alfresco-config>


And finally to the share-config-custom.xml:

       <config evaluator="string-compare" condition="activiti$PerformDirective">
          <forms>
             <form>
   
                <field-visibility>
                   <show id="bpm:workflowDescription"/>
                   <show id="bpm:assignee"/>
                   <show id="packageItems" />
                   <show id="itn:Company" />
                </field-visibility>
                <appearance>
   
                   <set id="" appearance="title" label-id="workflow.set.general" />
                   <set id="assignee" appearance="title" label-id="dir_assignee" />             
                   <set id="items" appearance="title" label-id="dir_items" />

                   <field id="bpm:workflowDescription" label-id="dir_description">
                      <control template="/org/alfresco/components/form/controls/textarea.ftl">
                         <control-param name="style">width: 95%</control-param>
                      </control>
                   </field>
                   <field id="bpm:assignee" label-id="dir_assign_to" set="assignee" />
                   <!–<field id="packageItems" set="items" label-id="dir_pitems" />–>
                   <field id="itn:Company" set="items" label-id="itn_company_name" />
                </appearance>
             </form>
          </forms>
       </config>


labels are in place too.

This gives no effect at all.

Any tips on where this goes wrong? Or any other suggestions?

Outcomes