09-07-2017 11:17 AM
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
09-07-2017 12:03 PM
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
09-07-2017 12:03 PM
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
Explore our Alfresco products with the links below. Use labels to filter content by product module.