你貌似开启了广告屏蔽插件... 写博客不容易,希望能将广告过滤去掉,谢谢!

算法 - 找出数组中子集乘积的最大值

2019-04-27   朋也   算法学习笔记   algorithm  

给定一个数组, 找出数组子集乘积的最大值

比如[2, 3, -2, 4] 数组, 子集有 [2,3], [2,3,-2], [2,3,-2,4], [3,-2], [3,-2,4], [-2,4]

每个乘积为 6, -12, -48, -6, -24, -8 所以最大值为 6

Activiti6.0教程(7) - 并行网关(ParallelGateway)用法

2019-04-25   朋也   activiti学习笔记   activiti  

先看官网描述

Gateways can also be used to model concurrency in a process. The most straightforward gateway to introduce concurrency in a process model, is the Parallel Gateway, which allows to fork into multiple paths of execution or join multiple incoming paths of execution.

翻译过来

网关还可以用于对流程中的并发性建模。在流程模型中引入并发性的最简单的网关是并行网关,它允许分叉到多个执行路径或连接多个传入的执行路径。

说白了就是流程有分支了, 就叫并行, 其实我觉得这个应该叫分支网关比较好, 不容易误导人, 举个例子

Activiti6.0教程(6) - 排它网关/异或网关(ExclusiveGateway)用法

2019-04-25   朋也   activiti学习笔记   activiti  

官方文档描述

An exclusive gateway (also called the XOR gateway or more technical the exclusive data-based gateway), is used to model a decision in the process. When the execution arrives at this gateway, all outgoing sequence flow are evaluated in the order in which they are defined. The sequence flow which condition evaluates to true (or which doesn’t have a condition set, conceptually having a ‘true’ defined on the sequence flow) is selected for continuing the process.

Note that the semantics of outgoing sequence flow is different to that of the general case in BPMN 2.0. While in general all sequence flow which condition evaluates to true are selected to continue in a parallel way, only one sequence flow is selected when using the exclusive gateway. In case multiple sequence flow have a condition that evaluates to true, the first one defined in the XML (and only that one!) is selected for continuing the process. If no sequence flow can be selected, an exception will be thrown.

Activiti6.0教程(1) - 环境搭建, 画一个流程图

2019-04-24   朋也   activiti学习笔记   activiti  

公司业务需要, 学习了一下Activiti, 做个系列博客来总结一下折腾的成果

Activiti能干啥?

它就是用来管理流程的, 处理业务流程的

举个例子, 在网上下单买东西, 订单的状态要有(下单, 发货, 付款, 收货, 评价) 等多个状态, 这里列的还是少的, 如果业务复杂些, 这种状态可能可以达到几十甚至上百个, 这时候如果还用代码去管理状态, 第一代码不好写, 总会出问题, 第二写代码的人很容易就弄错了, 代码的bug也就多了

Activiti就是通过在最开始时定义好一个流程, 大家开发使用中的业务流程都按这个来, 少了很多扯皮, 代码也好维护了