js中平台默认提供了this.getContext().getActivityLabel()可以获取当前activity显示名称
但是这个获取到的是process文件中定义的名字,获取不到流程模板中修改的名字

要获取流程模板中修改的名字需要调用action的方式,把当前任务的ID传给action,做参数到SA_Task中查询数据
如下:action中定义一个task的参数,action对应的java代码的定义

        public static String getModActivityName(String task){
                String ksql = "select task.sActivityName from SA_Task task where task = '"+task+"'";
                Table table = KSQL.select(ksql, null, "/system/data", null);
                String sActivityName = "";
                if(table.size()>0){
                        Row r = table.iterator().next();
                        sActivityName = r.getString("sActivityName");
                }
                return sActivityName;
        }

js中调用action

        Model.prototype.button1Click = function(event){
                var task = this.getContext().getTask();
                var param = new biz.Request.ActionParam();
                param.setString("task",task);                
                biz.Request.sendBizRequest({
                        "context" : this.getContext(),
                        "action" : "getModActivityName",
                        "parameters" : param,
                        "callback" : function(callbackData) {
                                if (callbackData.state) {
                                        alert("当前环节名:"+callbackData.response);

                                } else
                                        alert("执行失败");
                        }
                });
                
        };