Camunda中强大的监听服务

文章目录

  • 简介
  • 创建工程
  • JavaDelegate
  • TaskListener
  • ExecutionListener
  • 部署发起流程
    • CustomExecutionListener开始节点
    • CustomExecutionListener
    • CustomJavaDelegate
    • CustomExecutionListener
    • CustomTaskListener用户节点
  • Expression
  • Delegate Expression
  • 流程图

简介

Camunda预览了很多接口,以便于我们扩展,其中最重要的莫过于各种监听接口,本文就将接受三个最终常用的接口:

  1. ExecutionListener
  2. JavaDelegate
  3. TaskListener

并介绍下面3个ListenerType的区别:

  1. Java Class
  2. Expression
  3. Delegate expression

创建工程

我们还是使用SpringBoot来创建工程,可以通过下面链接生成一个集成Camunda的SpringBoot工程

SpringBoot Camunda工程生成

也可以直接拷贝下面的pom自己创建:

<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.example.workflow</groupId><artifactId>my-project</artifactId><version>1.0.0-SNAPSHOT</version><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>17</maven.compiler.source><maven.compiler.target>17</maven.compiler.target></properties><dependencyManagement><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-dependencies</artifactId><version>3.1.1</version><type>pom</type><scope>import</scope></dependency><dependency><groupId>org.camunda.bpm</groupId><artifactId>camunda-bom</artifactId><version>7.20.0</version><scope>import</scope><type>pom</type></dependency></dependencies></dependencyManagement><dependencies><dependency><groupId>org.camunda.bpm.springboot</groupId><artifactId>camunda-bpm-spring-boot-starter-rest</artifactId></dependency><dependency><groupId>org.camunda.bpm.springboot</groupId><artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId></dependency><dependency><groupId>org.camunda.bpm</groupId><artifactId>camunda-engine-plugin-spin</artifactId></dependency><dependency><groupId>org.camunda.spin</groupId><artifactId>camunda-spin-dataformat-all</artifactId></dependency><dependency><groupId>com.h2database</groupId><artifactId>h2</artifactId></dependency><dependency><groupId>com.mysql</groupId><artifactId>mysql-connector-j</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>3.1.1</version></plugin></plugins></build></project>

如果不想使用默认的H2数据库,可以参考下面修改配置文件:application.yaml

#spring.datasource.url: jdbc:h2:file:./camunda-h2-databasecamunda.bpm.admin-user:id: demopassword: demo#camunda.bpm.database:
#  schema-update: drop-createspring.datasource:url: jdbc:mysql://127.0.0.1:3306/clearn?characterEncoding=UTF-8&useUnicode=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghaidriver-class-name: com.mysql.cj.jdbc.Driverusername: timpassword: pd

两点需要注意:

  1. 需要添加相关数据库驱动lib
  2. camunda.bpm.database.schema-update好像不生效,需要手动创建一下Camunda相关表

自己测试,如果怕麻烦,直接使用默认的H2数据库即可。

然后就可以直接启动了:

@SpringBootApplication
public class Application {public static void main(String... args) {SpringApplication.run(Application.class, args);}}

JavaDelegate

对于Camunda的服务节点,我们可以绑定一个Java类,这个Java类只需要实现org.camunda.bpm.engine.delegate.JavaDelegate接口即可。

Type选Java Class:
服务节点

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;public class CustomJavaDelegate implements JavaDelegate {@Overridepublic void execute(DelegateExecution delegateExecution) throws Exception {System.out.println(CustomJavaDelegate.class.getName() + "--start");System.out.println("getProcessInstanceId:" + delegateExecution.getProcessInstanceId());System.out.println("getActivityInstanceId:" + delegateExecution.getActivityInstanceId());System.out.println("getCurrentActivityId:" + delegateExecution.getCurrentActivityId());System.out.println("getCurrentActivityName:" + delegateExecution.getCurrentActivityName());System.out.println("getProcessBusinessKey:" + delegateExecution.getProcessBusinessKey());System.out.println("getProcessDefinitionId:" + delegateExecution.getProcessDefinitionId());System.out.println("getBusinessKey:" + delegateExecution.getBusinessKey());System.out.println("getEventName:" + delegateExecution.getEventName());Double paramA = (Double) delegateExecution.getVariable("paramA");String paramB = (String) delegateExecution.getVariable("paramB");System.out.println(paramA);System.out.println(paramB);delegateExecution.setVariable("CustomJavaDelegateP1","p1");delegateExecution.setVariable("CustomJavaDelegateP2",500);System.out.println(CustomJavaDelegate.class.getName() + "--end");}
}

TaskListener

对于用户节点,我们可以配置TaskListener,来监听用户节点的一些事件,如:

  1. create
  2. assignment
  3. delete
  4. complete
  5. update
  6. timeout

user task

import org.camunda.bpm.engine.delegate.DelegateTask;
import org.camunda.bpm.engine.delegate.TaskListener;public class CustomTaskListener implements TaskListener {@Overridepublic void notify(DelegateTask delegateTask) {System.out.println(CustomTaskListener.class.getName() + "--start");System.out.println("processInstanceId:" + delegateTask.getProcessInstanceId());System.out.println("getAssignee:" + delegateTask.getAssignee());System.out.println("getId:" + delegateTask.getId());System.out.println("getName:" + delegateTask.getName());System.out.println("getEventName:" + delegateTask.getEventName());System.out.println("getPriority:" + delegateTask.getPriority());System.out.println("getCaseDefinitionId:" + delegateTask.getCaseDefinitionId());System.out.println("getCaseExecutionId:" + delegateTask.getCaseExecutionId());System.out.println("getDueDate:" + delegateTask.getDueDate());System.out.println("getTaskDefinitionKey:" + delegateTask.getTaskDefinitionKey());System.out.println("getOwner:" + delegateTask.getOwner());System.out.println("getDescription:" + delegateTask.getDescription());System.out.println(CustomTaskListener.class.getName() + "--end");}
}

ExecutionListener

基本所有节点都可以配置Execution listener:

执行listener

import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.ExecutionListener;public class CustomExecutionListener implements ExecutionListener {@Overridepublic void notify(DelegateExecution delegateExecution) throws Exception {System.out.println(CustomExecutionListener.class.getName() + "--start");System.out.println("getProcessInstanceId:" + delegateExecution.getProcessInstanceId());System.out.println("getProcessDefinitionId:" + delegateExecution.getProcessDefinitionId());System.out.println("getActivityInstanceId:" + delegateExecution.getActivityInstanceId());System.out.println("getCurrentActivityId:" + delegateExecution.getCurrentActivityId());System.out.println("getCurrentActivityName:" + delegateExecution.getCurrentActivityName());System.out.println("getProcessBusinessKey:" + delegateExecution.getProcessBusinessKey());System.out.println("getBusinessKey:" + delegateExecution.getBusinessKey());// 获取参数delegateExecution.getVariable("paramA");// 设置参数delegateExecution.setVariable("paramZ","paramZValue");// 可以获取ProcessEngine、RuntimeService来执行更多的操作RuntimeService runtimeService = delegateExecution.getProcessEngine().getRuntimeService();System.out.println(runtimeService);System.out.println(CustomExecutionListener.class.getName() + "--end");}
}

部署发起流程

部署工作流

部署成功

发起工作流

CustomExecutionListener开始节点

com.example.workflow.delegate.CustomExecutionListener--start
getProcessInstanceId:646f4f07-bf4c-11ee-a70e-00ffe7687986
getProcessDefinitionId:Process_1dnzxeh:3:830657fb-bf4a-11ee-b1f6-00ffe7687986
getActivityInstanceId:null
getCurrentActivityId:StartEvent_1
getCurrentActivityName:null
getProcessBusinessKey:listener-30
getBusinessKey:listener-30
org.camunda.bpm.engine.impl.RuntimeServiceImpl@1d380352
com.example.workflow.delegate.CustomExecutionListener--end

CustomExecutionListener

com.example.workflow.delegate.CustomExecutionListener--start
getProcessInstanceId:646f4f07-bf4c-11ee-a70e-00ffe7687986
getProcessDefinitionId:Process_1dnzxeh:3:830657fb-bf4a-11ee-b1f6-00ffe7687986
getActivityInstanceId:StartEvent_1:64747f30-bf4c-11ee-a70e-00ffe7687986
getCurrentActivityId:StartEvent_1
getCurrentActivityName:null
getProcessBusinessKey:listener-30
getBusinessKey:listener-30
org.camunda.bpm.engine.impl.RuntimeServiceImpl@1d380352
com.example.workflow.delegate.CustomExecutionListener--end

CustomJavaDelegate

com.example.workflow.delegate.CustomJavaDelegate--start
getProcessInstanceId:646f4f07-bf4c-11ee-a70e-00ffe7687986
getActivityInstanceId:Activity_1claer7:6475dec2-bf4c-11ee-a70e-00ffe7687986
getCurrentActivityId:Activity_1claer7
getCurrentActivityName:bzService
getProcessBusinessKey:listener-30
getProcessDefinitionId:Process_1dnzxeh:3:830657fb-bf4a-11ee-b1f6-00ffe7687986
getBusinessKey:listener-30
getEventName:null
3.14
haha
com.example.workflow.delegate.CustomJavaDelegate--end

CustomExecutionListener

com.example.workflow.delegate.CustomExecutionListener--start
getProcessInstanceId:646f4f07-bf4c-11ee-a70e-00ffe7687986
getProcessDefinitionId:Process_1dnzxeh:3:830657fb-bf4a-11ee-b1f6-00ffe7687986
getActivityInstanceId:Activity_1xjraoy:6476c927-bf4c-11ee-a70e-00ffe7687986
getCurrentActivityId:Activity_1xjraoy
getCurrentActivityName:userTask
getProcessBusinessKey:listener-30
getBusinessKey:listener-30
org.camunda.bpm.engine.impl.RuntimeServiceImpl@1d380352
com.example.workflow.delegate.CustomExecutionListener--end

CustomTaskListener用户节点

com.example.workflow.delegate.CustomTaskListener--start
processInstanceId:646f4f07-bf4c-11ee-a70e-00ffe7687986
getAssignee:null
getId:64771749-bf4c-11ee-a70e-00ffe7687986
getName:userTask
getEventName:create
getPriority:50
getCaseDefinitionId:null
getCaseExecutionId:null
getDueDate:null
getTaskDefinitionKey:Activity_1xjraoy
getOwner:null
getDescription:null
com.example.workflow.delegate.CustomTaskListener--end

Expression

Expression的优势在于不用继承特别的类,就可以调用相关方法。

注意:需要将类注入容器

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.springframework.stereotype.Component;/*** #{expressionDelegateExecution.exe(execution)}*/
@Component("expressionDelegateExecution")
public class ExpressionDelegateExecution {public void exe(DelegateExecution execution){String processInstanceId = execution.getProcessInstanceId();System.out.println("ExpressionDelegateExecution:" + processInstanceId);}
}

表达式配置
表达式中的execution是内置变量,Camunda会自动注入一个DelegateExecution实例,还有一个常用的内置变量task,Camunda会自动注入一个DelegateTask实例。

Delegate Expression

Delegate Expression可以看做是加强版的Expression。

它最大的一个特点是对于实现了:

  1. ExecutionListener
  2. JavaDelegate
  3. TaskListener

上面的类,Delegate Expression可以直接配置bean名称就可以,Camunda会自动调用其方法。

还是需要注入容器才行。

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;/*** #{delegateExpressionComponent}*/
@Component("delegateExpressionComponent")
public class DelegateExpressionComponent implements JavaDelegate {@Overridepublic void execute(DelegateExecution execution) throws Exception {System.out.println("DelegateExpressionComponent:" + execution.getProcessInstanceId());}
}

delegate表达式配置

流程图

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_13pugtj" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.19.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.20.0"><bpmn:process id="Process_1dnzxeh" name="service" isExecutable="true" camunda:historyTimeToLive="180"><bpmn:extensionElements><camunda:executionListener class="com.example.workflow.delegate.CustomExecutionListener" event="end" /><camunda:executionListener class="com.example.workflow.delegate.CustomExecutionListener" event="start" /></bpmn:extensionElements><bpmn:startEvent id="StartEvent_1"><bpmn:extensionElements><camunda:executionListener class="com.example.workflow.delegate.CustomExecutionListener" event="start" /></bpmn:extensionElements><bpmn:outgoing>Flow_0eji7wy</bpmn:outgoing></bpmn:startEvent><bpmn:serviceTask id="Activity_1claer7" name="bzService" camunda:class="com.example.workflow.delegate.CustomJavaDelegate"><bpmn:incoming>Flow_0eji7wy</bpmn:incoming><bpmn:outgoing>Flow_0c190eu</bpmn:outgoing></bpmn:serviceTask><bpmn:sequenceFlow id="Flow_0eji7wy" sourceRef="StartEvent_1" targetRef="Activity_1claer7" /><bpmn:sequenceFlow id="Flow_0c190eu" sourceRef="Activity_1claer7" targetRef="Activity_1xjraoy" /><bpmn:userTask id="Activity_1xjraoy" name="userTask"><bpmn:extensionElements><camunda:taskListener class="com.example.workflow.delegate.CustomTaskListener" event="create" id="Lid255" /><camunda:executionListener class="com.example.workflow.delegate.CustomExecutionListener" event="start" /></bpmn:extensionElements><bpmn:incoming>Flow_0c190eu</bpmn:incoming><bpmn:outgoing>Flow_0383lfn</bpmn:outgoing></bpmn:userTask><bpmn:endEvent id="Event_0aws3kb"><bpmn:extensionElements><camunda:executionListener class="com.example.workflow.delegate.CustomExecutionListener" event="start" /></bpmn:extensionElements><bpmn:incoming>Flow_0383lfn</bpmn:incoming></bpmn:endEvent><bpmn:sequenceFlow id="Flow_0383lfn" sourceRef="Activity_1xjraoy" targetRef="Event_0aws3kb" /></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1dnzxeh"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds x="179" y="99" width="36" height="36" /></bpmndi:BPMNShape><bpmndi:BPMNShape id="Activity_04xt5m2_di" bpmnElement="Activity_1claer7"><dc:Bounds x="280" y="77" width="100" height="80" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id="Activity_1frv2ve_di" bpmnElement="Activity_1xjraoy"><dc:Bounds x="450" y="77" width="100" height="80" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id="Event_0aws3kb_di" bpmnElement="Event_0aws3kb"><dc:Bounds x="602" y="99" width="36" height="36" /></bpmndi:BPMNShape><bpmndi:BPMNEdge id="Flow_0eji7wy_di" bpmnElement="Flow_0eji7wy"><di:waypoint x="215" y="117" /><di:waypoint x="280" y="117" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="Flow_0c190eu_di" bpmnElement="Flow_0c190eu"><di:waypoint x="380" y="117" /><di:waypoint x="450" y="117" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id="Flow_0383lfn_di" bpmnElement="Flow_0383lfn"><di:waypoint x="550" y="117" /><di:waypoint x="602" y="117" /></bpmndi:BPMNEdge></bpmndi:BPMNPlane></bpmndi:BPMNDiagram>
</bpmn:definitions>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/658452.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MTK8365安卓核心板_联发科MT8365(Genio 350)核心板规格参数

MTK8365安卓核心板是一款高性能的嵌入式处理器产品&#xff0c;基于联发科领先的SoC架构和先进的12纳米工艺。它集成了四核ARM Cortex-A53处理器&#xff0c;每个核心频率高达2.0 GHz&#xff0c;搭载强大的多标准视频加速器&#xff0c;支持高达1080p 60fps的视频解码。此外&a…

数据库(SQL)

目录 1 触发器 1.1 触发器简介 1.2 触发器的创建 语法 说明 1.3 示例 2 存储过程 2.1 什么是存储过程&#xff08;函数&#xff09; 2.1.1 存储过程和存储函数的区别 2.2 优势 2.3 应用场景 2.4 存储过程的创建和使用 说明 各参数类型所实现的存储过程 无参数无返…

[cmake]CMake Error: Could not create named generator Visual Studio 16 2019解决方法

配置flycv时&#xff0c;cmake以下代码会报错第二行的错误&#xff0c;网上解决方法为第三行代码 cmake .. -G "Visual Studio 16 2019 Win64" CMake Error: Could not create named generator Visual Studio 16 2019 cmake .. -G "Visual Studio 16 2019"…

【MBtiles数据格式说明】GeoServer改造Springboot番外系列一

一、MBTiles数据格式 MBTiles格式是指由MapBox制定的一种将瓦片地图数据存储到SQLite数据库中并可快速使用、管理和分享的规范&#xff0c;是一种用于即时使用和高效传输的规范。MBTiles既可以用作栅格输入数据存储&#xff0c;也可以用作WMSGetMap输出格式。规范有1.0&#xf…

C++类和对象:多态应用实例

利用多态实现计算机组转流程&#xff1a; polymorphic -> 多态 基础零件&#xff08;抽象类&#xff09;&#xff1a; class CPU { public:virtual void calculate() 0; }; class VideoCard { public:virtual void display() 0; }; class Memory { public:virtual void…

每日算法打卡:动态求连续区间和 day 31

文章目录 原题链接题目描述输入格式输出格式数据范围输入样例&#xff1a;输出样例&#xff1a; 题目分析示例代码树状数组线段树 原题链接 1264. 动态求连续区间和 题目难度&#xff1a;简单 题目来源&#xff1a;《信息学奥赛一本通》 题目描述 给定 n 个数组成的一个数…

rp-bf:一款Windows下辅助进行ROP gadgets搜索的Rust库

关于rp-bf rp-bf是一款Windows下辅助进行ROP gadgets搜索的Rust库&#xff0c;该工具可以通过模拟Windows用户模式下的崩溃转储来爆破枚举ROP gadgets。 在很多系统安全测试场景中&#xff0c;研究人员成功劫持控制流后&#xff0c;通常需要将堆栈数据转移到他们所能够控制的…

第一批 Apple Vision Pro 开箱和佩戴体验新鲜出炉!!!

注: 本文转自微信公众号 BravoAI (专注AI资讯和技术分享), 原文网址:第一批 Apple Vision Pro 开箱和佩戴体验新鲜出炉!!!, 扫码关注公众号 编者按: 整个AR/VR行业都在等AVP, 期待它能带来ChatGPT般的冲击 AVP(Apple Vision Pro) 是苹果公司研发的第一款"空间计算 (Spa…

VOD-SLAM 复现 AirDos 复现

VOD-SLAM 复现 参考&#xff1a;https://www.mianshigee.com/project/halajun-VDO_SLAM/ 下载&#xff1a; git clone https://github.com/halajun/VDO_SLAM.git VDO-SLAMCSparse 库安装 sudo apt-get install libsuitesparse-dev解决&#xff1a;fatal error: opencv2/xfea…

基础小白快速入门python------Python程序设计结构,循环

循环在计算机中&#xff0c;是一个非常重要的概念&#xff0c;是某一块儿代码的不断重复运行&#xff0c;是一种逻辑思维 在编程中的体现&#xff0c;运用数学思维加代码结合加数据&#xff0c;就构成了一个循环。 在Python中&#xff0c;循环主要分为三大类 for循环 while循…

Revit中使用依赖注入

依赖注入的技术已经很成熟&#xff0c;本文主要是说明一下Revit中的适用版本与介绍相关的开源项目。 版本问题 版本 目前的依赖注入包无法支持Revit 2020 以下的版本&#xff0c;原因是因为包中的依赖项与Revit本身的依赖项不一致导致的&#xff0c;所以说如果使用Revit DI…

力扣hot100 括号生成 递归回溯 超简洁版

Problem: 22. 括号生成 Code 使用 static 会被复用 class Solution {List<String> ans new ArrayList<>();public List<String> generateParenthesis(int n){dfs(n, n, "");return ans;}/*** param l 左括号待补个数* param r 右括号待补个数*…

nodejs+vue+ElementUi电商购物个性化商城推荐系统gqfe

电本电商个性化推荐系统是为了提高用户查阅信息的效率和管理人员管理信息的工作效率&#xff0c;可以快速存储大量数据&#xff0c;还有信息检索功能&#xff0c;这大大的满足了用户和管理员这二者的需求。操作简单易懂&#xff0c;合理分析各个模块的功能&#xff0c;尽可能优…

ansible 常用命令 基本说明 个人备忘

linux下设置一台机器的名称为ansible hostnamectl set-hostname ansible //设置一台机器的名称为master-01 hostnamectl set-hostname master-01 hostnamectl set-hostname master-02 hostnamectl set-hostname node01 hostnamectl set-hostname node02 hostnamectl set-…

flutter 设置图片与文字的基线对齐

如题&#xff1a;如何实现图片和文字的基线对齐 众所周知&#xff0c;文字含有上下填充&#xff0c;这个填充是框架所给予的。 背景 在开发中&#xff0c;我当时遇到比较简单的布局&#xff0c;首先是左边图标右边文字&#xff0c;如下图所示&#xff0c; 很自然的就想到用R…

linux 使用命令创建mysql账户

目录 前言创建步骤 前言 mysql默认有一个root用户&#xff0c;这个账户权限太大了&#xff0c;用起来不太安全&#xff0c;我们通常是重新那家一个账户用于一般的数据库操作&#xff0c;下面介绍如何通过命令创建一个mysql账户。 创建步骤 登录mysql mysql -u root -p输入roo…

Unity3D正则表达式的使用

系列文章目录 unity工具 文章目录 系列文章目录前言一、匹配正整数的使用方法1-1、代码如下1-2、结果如下 二、匹配大写字母2-1、代码如下1-2、结果如下 三、Regex类3-1、Match&#xff08;&#xff09;3-2、Matches()3-3、IsMatch&#xff08;&#xff09; 四、定义正则表达式…

非内积级联学习

1.首页推荐非内积召回现状 非内积召回源是目前首页推荐最重要的召回源之一。同时非内积相比于向量化召回最终仅将user和item匹配程度表征为embeding内积&#xff0c;非内积召回仅保留item embedding&#xff0c;不构造user显式表征&#xff0c;而是通过一个打分网络计算用户-商…

CSS中的transition属性

CSS中的transition属性可以让你在一定的时间间隔内平滑地改变一个元素从一个样式到另一个样式。这个属性主要应用于以下几种CSS属性&#xff1a; 宽度&#xff08;width&#xff09;高度&#xff08;height&#xff09;背景颜色&#xff08;background-color&#xff09;颜色&…

Vue禁止指定vue页面缩放适配移动端

index.html中 head标签中设置meta元数据 <meta name"viewport" content"widthdevice-width,initial-scale1,minimum-scale1,maximum-scale1,user-scalable0">这段代码是HTML中用于设置移动设备视口的meta标签。让我们逐步解释&#xff1a; widthde…