AND要设置环节默认不选中,需要扩展流转对话框
AND和XOR都是在同一个方法中控制选择的环节的,因此可以参考xor设置默认选中指定环节中扩展实现
对Model.prototype.addActivity函数的定义进行如下修改:
Model.prototype.addActivity = function(activityRows, executorRows, activity, control){ if (activity.isSelectable()){ var toItem = control.getToItemByID(activity.getID()); var isEnd = toItem.isEnd(); var selected = toItem.isSelected(); if(activity.isOptional()) activityRows.push({rowid: activity.getID(), selected: false, isEnd: isEnd, label:activity.getLabel()}); else activityRows.push({rowid: activity.getID(), selected: selected, isEnd: isEnd, label:activity.getLabel()}); this.addExecutors(executorRows, toItem); } var children = activity.getChildren(); if (children && children.length>0){ for (var i=0; i<children.length; i++){ this.addActivity(activityRows, executorRows, children[i], control); } } };
评一波