当前位置:网站首页>Technical practice dry goods | from workflow to workflow
Technical practice dry goods | from workflow to workflow
2022-07-27 17:13:00 【InfoQ】
background
Preface
One 、 workflow
1.1 Dispatch
- High availability
- adopt DAG Realize the visual arrangement of task nodes , No complex platform language learning costs , Task scheduling is out of the box ;
- Support configuration sequence scheduling 、 Successfully scheduled 、 Failure scheduling and other scheduling relationships , Flexibly adjust the scheduling strategy ;
- Support on time 、 By day 、 By week 、 Run the workflow on a monthly basis , The running results can be quickly pushed to nailing 、 Enterprise wechat and other platforms , A configuration , Continuously available .
- high reliability : A lot of decentralization Master And many Worker Distributed architecture , Avoid single point of failure , Enhance system reliability .
- High scalability : Can be based on SDK Develop custom task types and seamlessly connect processes .
{
name: '',
description: '',
}
[
{
fieldName: 'name',
label: ' name ',
type: 'STRING',
defaultValue: '',
},
{
fieldName: 'description',
label: ' describe ',
type: 'TEXT',
defaultValue: '',
},
]

- When selecting a square
{
shape: 'square',
side: 8,
}

- When selecting a circle
{
shape: 'circle',
radius: 4,
}

sideradiusshape[
{
fieldName: 'shape',
label: ' graphics ',
type: 'MODEL',
model: {
modelType: 'SELECT',
labels: [ ' round ', ' Square ' ],
values: [ 'circle', 'square' ],
},
},
{
fieldName: 'radius',
label: ' radius ',
type: 'NUMBER',
dependsOnMap: {
shape: [ 'circle' ],
},
defaultValue: 4,
},
{
fieldName: 'side',
label: ' Side length ',
type: 'NUMBER',
dependsOnMap: {
shape: [ 'square' ],
},
defaultValue: 8,
},
]
function isDependsOnMap (dependsOnMap, config) {
const fieldNames = Object.keys(dependsOnMap || {})
if (fieldNames.length === 0) return true
return fieldNames.every(fieldName => {
const values = dependsOnMap[fieldName] || []
return values.indexOf(_get(config, fieldName)) > -1
})
}
[
{
fieldName: 'fieldName1',
label: ' Components 1',
type: 'MODEL',
model: {
modelType: 'SELECT',
labels: [ ' round ', ' Square ' ],
values: [ 'circle', 'square' ],
from: { fieldName: 'disabledFieldName' }, // Component dependent 3 Settings in , Judge whether the current component needs disabled
},
},
{
fieldName: 'fieldName2',
label: ' Components 2',
type: 'NUMBER',
},
{
fieldName: 'fieldName3',
label: ' Components 3',
type: 'MODEL',
model: {
modelType: 'BOOLEAN',
targetSharedFieldName: 'disabledFieldName', // Set data fields to the data sharing layer
},
},
]
model.targetSharedFieldNamemodel.fromconst SharedContext = React.createContext({
updateFieldValue: () => {}, // Update fields value
getFieldValue: () => {}, // Get field value
})
function Comp1 ({ definition }) {
const { targetSharedFieldName } = definition.model
const { updateFieldValue } = useContext(SharedContext)
useEffect(() => {
updateFieldValue(targetSharedFieldName, value)
}, [ deps ])
}
function Comp2 ({ definition }) {
const { from } = definition.model
const { getFieldValue } = useContext(SharedContext)
const value = getFieldValue(from)
}

{
list: [
{ name: 'a', age: 12 },
{ name: 'b', age: 18 },
],
}
[
{
fieldName: 'list',
label: ' list ',
type: 'MODEL',
model: {
modelType: 'LIST',
definitions: [
{
fieldName: 'name',
label: ' name ',
type: 'STRING',
},
{
fieldName: 'age',
label: ' Age ',
type: 'NUMBER',
},
],
},
},
]

LIST1.3 summary
Two 、DAG

- Node information (nodes)
- Node location (location)
- Connection information (edges)
- Edit and read-only status
- Playground
- Node drag
- Connection addition and deletion
- newly added / Replication node
- Select the node in the box to copy in batch / Delete
- Automatic layout / Cancel the operation
- Renderer
- Zoom in and out
- Drag the canvas
- Click
- Provide style configuration ( Such as node size / Line width, etc )
- Support width height adaptation
- Custom draw nodes and lines
- Other rendering capabilities are enhanced ( Such as annotation function , Itself does not belong to DAG The function of , Instead, consider the implementation of extended functions )
|- ConfigContext --- Configuration layer
|- Playground --- Editing layer
|- ResponsiveProvider --- Adaptive wide high-rise ( Optional )
|- Renderer --- Read-only layer , Show only
|- Nodes --- node
|- Edges --- attachment
2.1 Read only use
<ConfigContext.Provider value={{ node: { width: 56, height: 56 } }}>
<ResponsiveProvider>
<Renderer nodes={nodes} location={location} edges={edges} />
</ResponsiveProvider>
</ConfigContext.Provider>
2.2 Editors use
<ConfigContext.Provider value={{ node: { width: 60, height: 60 } }}>
<Playground nodes={nodes} location={location} edges={edges} />
</ConfigContext.Provider>
2.3 Custom node and connection use
<ConfigContext.Provider value={{ node: { width: 56, height: 56 } }}>
<Renderer nodes={nodes} location={location} edges={edges}>
<Nodes>
{(props) => <CustomNode />}
</Nodes>
<Edges>
{(props) => <CustomEdge />}
</Edges>
</Renderer>
</ConfigContext.Provider>
2.4 Bottom layer drawing
- canvas :svg
- node :foreignObject
- attachment :path




d = M P0x P0y Q P1x P1y P2x P2y T P4x P4y2.5 Layout
function rank(g) {
switch(g.graph().ranker) {
case "network-simplex": networkSimplexRanker(g); break;
case "tight-tree": tightTreeRanker(g); break;
case "longest-path": longestPathRanker(g); break;
default: networkSimplexRanker(g);
}
}
network-simplextight-treelongest-pathnetwork-simplex and tight-tree

longest-path

3、 ... and 、 Other workflows
3.1
n8n

- When configuring nodes, you can see what the output data of the previous node is , It is convenient to configure in the current step
- The node configuration can be executed immediately , See the corresponding output data
- There are some data visualization enhancements on the connection , For example, how many lines of output data
- You can directly click Add to select the post node , Omit some connection operations

3.2
Orange


Four 、 Summary and reflection
4.1 possibility
边栏推荐
- .net core with microservices - what is a microservice
- Enumeration and union of C language
- C语言之文件操作
- Niuke topic - parity rearrangement of linked list, right view of output binary tree, bracket generation, first non repeating character in character stream
- 后台管理系统 权限设置大致流程
- 内置对象(下)
- Ten thousand words analysis ribbon core components and operation principle
- Day 7 summary & homework
- MPC5744p时钟模块
- 在CRA创建的项目中使用@并让其识别@路径并给出路径提示
猜你喜欢

mysql视图及存储过程

Program environment and preprocessing of C language

Kubernetes第七篇:使用kubernetes部署prometheus+grafana监控系统(Kubernetes工作实践类)

Swift QQ授权登录 坑集

Shardingsphere-proxy-5.0.0 distributed snowflake ID generation (III)

SAP UI5 FileUploader 的本地文件上传技术实现分享

C语言之指针进阶

SAP UI5 FileUploader 使用的隐藏 iframe 和 form 元素的设计明细

C语言之指针初级

一个端到端的基于 form 表单的文件上传程序,包含客户端和服务器端
随机推荐
MySQL - linked table query
Dynamic memory allocation in C language
Project exercise: the function of checking and modifying tables
第7天总结&作业
UML diagram introduction
Measured: the performance of cloud RDS MySQL is 1.6 times that of self built
Basic use and optimization of uitableview
每条你收藏的资讯背后,都离不开TA
.NET Core with 微服务 - 什么是微服务
What is JSP?
Data collection: skillfully using Bloom filter to extract data summary
$attrs与$listeners组件传值
合工大苍穹战队视觉组培训Day7——视觉,jetson naon与D435i
File class byte input and output stream
C语言之指针进阶
SAP UI5 FileUploader 使用的隐藏 iframe 和 form 元素的设计明细
了解Bom与DOM的基本属性
KMP模板——字符串匹配
How to extract tables from PDF through C /vb.net
MySQL : 函数