Why customized field can be defined in startEvent but not userTask? I have defined customized field called scheduledPublishDate in my workflow content model with namespace ut. Here is the partial workflow definition:
<startEvent id="start" name="Start" activiti:formKey="ut:scheduleTask">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>
logger.log("##########workflow start:start!!!");
if (typeof ut_scheduledPublishDate != 'undefined') {
logger.log("##########workflow start::ut_scheduledPublishDate defined");
}
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</startEvent>
It does print out "##########workflow start::ut_scheduledPublishDate defined" But if I change startEvent to use formKey as wf:submitReviewTask with the following fragment
<userTask id="SchedulePublishTast" name="Schedule Publish Task" activiti:assignee="${initiator.properties.userName}" activiti:formKey="ut:scheduleTask">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
if (typeof ut_scheduledPublishDate != 'undefined') {
logger.log("##########ut_scheduledPublishDate DOES defined!!!");
} else {
logger.log("##########ut_scheduledPublishDate NOT defined!!!");
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>It prints out "##########ut_scheduledPublishDate NOT defined!!!"
The same formKey ut:scheduleTask. If used in startEvent, I can get defined customized field but I can't get it if used in userTask. But I can see the field from user interface. Anybody knows what I might be missing. Thanks in advance
Solved! Go to Solution.
Never mind. I resolved by myself. What is interesting is that I don't need to set variable in startEvent but need it in userTask for other tasks to refer
Never mind. I resolved by myself. What is interesting is that I don't need to set variable in startEvent but need it in userTask for other tasks to refer
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
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.