10-18-2016 06:30 AM
I can't understand why but the assignment doesn't work and the customized form for psw:activitiCreaCS hasn't the fields pswSGAincaricato and pswSincaricato
In my bpmn file I have an user task event where I need two select two assignees for other user tasks, like this:
<userTask id="creaCS" name="Crea Certificato di Servizio" activiti:candidateGroups="DSGA" activiti:formKey="psw:activitiCreaCS">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[logger.log("Log Log");
execution.setVariable('DSGAincaricato', task.getVariable('psw_DSGAincaricato'));
execution.setVariable('DSincaricato', task.getVariable('psw_DSincaricato'));]]>
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="valutaCS" name="Valuta Certificato di Servizio" activiti:assignee="${DSincaricato.properties.userName}" activiti:formKey="psw:activitiValutaCS">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>if(task.getVariableLocal('psw_esitoValutazioneCS') == 'Approvato'){
execution.setVariable('psw_prosegui', true);
}else{
execution.setVariable('psw_prosegui', false);
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
Following a tutorial I wrote a model:
<type name="psw:activitiCreaCS">
<parent>bpm:startTask</parent>
<associations>
<association name="pswSGAincaricato">
<title>DSGA incaricato</title>
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>cmerson</class>
<mandatory>false</mandatory>
<many>false</many>
</target>
</association>
<association name="pswSincaricato">
<title>DS incaricato</title>
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>cmerson</class>
<mandatory>false</mandatory>
<many>false</many>
</target>
</association>
</associations>
</type>
<type name="psw:activitiValutaCS">
<parent>bpm:activitiOutcomeTask</parent>
<properties>
<property name="psw:esitoValutazioneCS">
<type>d:text</type>
<default>Respinto</default>
<constraints>
<constraint type="LIST">
<parameter name="allowedValues">
<list>
<value>Approvato</value>
<value>Respinto</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpmackageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpmutcomePropertyName">
<default>{http://www.portaleScuola.com/model/workflow/1.0}esitoValutazioneCS</default>
</property>
</overrides>
</type>
And a share-config-custom.xml like this
<config evaluator="task-type" condition="psw:activitiCreaCS">
<forms>
<form id="workflow-details">
<field-visibility>
<show id="bpm:workflowDescription"/>
<show id="packageItems"/>
<show id="pswSGAincaricato"/>
<show id="pswSincaricato"/>
<show id="transitions"/>
<show id="bpm:status"/>
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="progress" appearance="title" label-id="workflow.set.task.progress" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<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 set="actors" id="pswSGAincaricato">
<control template="/org/alfresco/components/form/controls/authority.ftl">
</control>
</field>
<field set="actors" id="pswSincaricato">
<control template="/org/alfresco/components/form/controls/authority.ftl">
</control>
</field>
<field id="bpm:status" set="progress" />
</appearance>
</form>
<form>
<field-visibility>
<show id="bpm:workflowDescription"/>
<show id="packageItems"/>
<show id="pswSGAincaricato"/>
<show id="pswSincaricato"/>
<show id="transitions"/>
<show id="bpm:status"/>
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="progress" appearance="title" label-id="workflow.set.task.progress" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<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 set="actors" id="pswSGAincaricato">
<control template="/org/alfresco/components/form/controls/authority.ftl">
</control>
</field>
<field set="actors" id="pswSincaricato">
<control template="/org/alfresco/components/form/controls/authority.ftl">
</control>
</field>
<field id="bpm:status" set="progress" />
</appearance>
</form>
</forms>
</config>
10-22-2016 09:00 AM
I'm doing it like in Creating Custom Advanced Workflows.
10-24-2016 10:32 AM
Zip up your source and attach it, please.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.