cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Metadata in Task-Edit Page

dave984
Champ in-the-making
Champ in-the-making
Hi all, i've designed a simple workflow in Activity and deployed in Alfresco.
Referring to the Alfresco wiki i would see my custom metadata not only in start-workflow page but also in task-edit page.
Here is the workflow model:

    <imports>
        <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
        <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
    </imports>
    <namespaces>
        <namespace uri="http://www.someco.it/model/workflow/1.0" prefix="scwf" />
    </namespaces>
    <types>
        <type name="scwf:submitTask">
            <parent>bpm:startTask</parent>
            <properties>
                <property name="scwf:helloName">
                    <type>d:text</type>
                    <mandatory>true</mandatory>
                    <multiple>false</multiple>
                </property>
            </properties>
            <mandatory-aspects>
          <aspect>scwf:workInfo</aspect>
            </mandatory-aspects>
        </type>       
    </types>
    <aspects>       
             <aspect name="scwf:workInfo">
      <properties>
         <property name="scwf:workDescription">
            <type>d:text</type>
            <mandatory>true</mandatory>
         </property>
      </properties>
        </aspect>
      </aspects>      
</model>


And here the snippet from share-config-custom.xml:

<config evaluator="task-type" condition="scwf:submitTask">   
      <forms>
         <form>
            <field-visibility>
          <show id="bpm:workflowDescription" />
               <show id="packageItems" />             
               <show id="scwf:helloName" />
               <show id="transitions" />              
               <show id="scwf:workDescription" />
            </field-visibility>
            <appearance>
               <set id="" appearance="title" label-id="workflow.set.general" />
                <set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
                <set id="assignee" appearance="title" label-id="workflow.set.assignee" />
                <set id="items" appearance="title" label-id="workflow.set.items" />
                <set id="response" appearance="title" label-id="workflow.set.response" />
                <field id="bpm:workflowDescription" label-id="workflow.field.message">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl">
                        <control-param name="style">width: 95%</control-param>
                    </control>
                </field>
                <field id="packageItems" set="items" />
                <field id="transitions" set="response" />                                                          
                <field id="scwf:workDescription" set="response">
          <control template="/org/alfresco/components/form/controls/textarea.ftl" />
      </field>
                <field id="scwf:helloName" set="response" />              
            </appearance>
         </form>
      </forms>
    </config>

As i said i can completely see my custom metadata in start-workflow page…why not in task-detail page?
4 REPLIES 4

mitpatoliya
Star Collaborator
Star Collaborator
change this

condition="scwf:submitTask"


to

condition="jbpm$scwf:submitTask"

dave984
Champ in-the-making
Champ in-the-making
Mits thanks for your contribution, but it doesn't solved.
Maybe it's wrong in the workflow model i have as parent the bpm:startTask?

<type name="scwf:submitTask">
  <parent>bpm:startTask</parent>

romschn
Star Collaborator
Star Collaborator
How does your processdefinition bpmn20.xml look like?
In the custom workflowModel.xml, start task of the workflow process is a subtype of bpmSmiley FrustratedtartTask. The other tasks which appears in the flow are the subtype of bpm:workflowTask.


dave984
Champ in-the-making
Champ in-the-making
Ramesh maybe this is the issue.
Conceptually in my simple workflow i have a StartEvent, an Alfresco User Task, an Alfresco Script Task and then an End Event.
This is the bpmn:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="SCUI" name="SC UI" isExecutable="true">
    <startEvent id="startevent1" name="Start" activiti:formKey="scwf:submitTask"></startEvent>
    <userTask id="alfrescoUsertask1" name="Alfresco User Task" activiti:assignee="${initiator.properties.userName}" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome'));]]></activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <serviceTask id="alfrescoScripttask1" name="Alfresco Script Task" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
      <extensionElements>
        <activiti:field name="script">
          <activiti:string><![CDATA[logger.log("The outcome of the review task is: " + wf_reviewOutcome);]]></activiti:string>
        </activiti:field>
      </extensionElements>
    </serviceTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="alfrescoUsertask1">
      <extensionElements>
        <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[logger.log("Hello, " + scwf_helloName + "!");]]></activiti:string>
          </activiti:field>
        </activiti:executionListener>
      </extensionElements>
    </sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="alfrescoUsertask1" targetRef="alfrescoScripttask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow3" sourceRef="alfrescoScripttask1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_SCUI">
    <bpmndi:BPMNPlane bpmnElement="SCUI" id="BPMNPlane_SCUI">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="140.0" y="140.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="alfrescoUsertask1" id="BPMNShape_alfrescoUsertask1">
        <omgdc:Bounds height="55.0" width="105.0" x="240.0" y="130.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="alfrescoScripttask1" id="BPMNShape_alfrescoScripttask1">
        <omgdc:Bounds height="55.0" width="105.0" x="400.0" y="130.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="570.0" y="140.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="175.0" y="157.0"></omgdi:waypoint>
        <omgdi:waypoint x="240.0" y="157.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="345.0" y="157.0"></omgdi:waypoint>
        <omgdi:waypoint x="400.0" y="157.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="505.0" y="157.0"></omgdi:waypoint>
        <omgdi:waypoint x="570.0" y="157.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>


Attached an Image.
Conceptually why i need another task?