<?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="exercise11" name="Final Exercise">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>logger.log("initializing…");</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<startEvent id="alfrescoStartevent1" name="Alfresco start" activiti:formKey="wfge:startSopReview"></startEvent>
<userTask id="usertask1" name="Review SOP" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="wfge:sopReview">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>logger.log("task1 complete…");</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
….
<?xml version="1.0" encoding="UTF-8"?>
<model name="wfge:workflow-green-energy" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>example</description>
<author>Training</author>
<version>1.1</version>
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm"/>
<import uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/>
</imports>
<namespaces>
<namespace uri="http://www.alfresco.org/model/training/1.0" prefix="wfge"/>
</namespaces>
<types>
<type name="wfge:startSopReview">
<parent>bpm:startTask</parent>
<mandatory-aspects>
<aspect>wfge:instructionAspect</aspect>
</mandatory-aspects>
</type>
<type name="wfge:sopReview">
<parent>wf:activitiReviewTask</parent>
<mandatory-aspects>
<aspect>wfge:instructionAspect</aspect>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
….
</types>
<aspects>
<aspect name="wfge:instructionAspect">
<properties>
<property name="wfge:instructions">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</aspect>
</aspects>
</model>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<!– Registration of workflow models –>
<bean id="ge.workflowBootstrap" parent="workflowDeployer">
<property name="models">
<list>
<value>alfresco/extension/sopWorkflowModel.xml</value>
</list>
</property>
<property name="workflowDefinitions">
<list>
<props>
<prop key="engineId">activiti</prop>
<prop key="location">alfresco/extension/exercise11.bpmn20.xml</prop>
<prop key="mimetype">text/xml</prop>
<prop key="redeploy">true</prop>
</props>
</list>
</property>
</bean>
</beans>
<config evaluator="string-compare" condition="activiti$exercise11">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="bpm:workflowDueDate" />
<show id="bpm:workflowPriority" />
<show id="bpm:assignee" />
<show id="packageItems" />
<show id="wfge:instructions" />
</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="items" appearance="title" label-id="workflow.set.items" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<set id="assignee" appearance="title" label-id="workflow.set.assignee" />
<field id="bpm:assignee" label-id="workflow.field.assign_to" set="assignee" />
<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="wfge:instructions" label-id="Instructions for Reviewers" set="info">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
<control-param name="style">width: 95%</control-param>
</field>
<field id="bpm:workflowDueDate" label-id="workflow.field.due" set="info" />
<field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
<control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
</field>
<field id="packageItems" set="items" />
</appearance>
</form>
</forms>
</config>
….
Has intentado con:
<code>
bpm_assignees.get(0).properties.userName
</code>
".get()" seria un arreglo para recorrer si cuentas con varios usuarios, yo por ejemplo utilice este codigo para asignar permisos a un archivo a un unico usuario:
<code>
for (var u = 0; u < bpm_package.children.length; u++)
{
bpm_package.children.setPermission("Collaborator", bpm_assignees.get(0).properties.userName);
}
</code>
Saludos
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.