Flowable 6.6.0 BPMN用户指南 -(6)部署 - 6.5 提供流程图 6.6 生成流程图 6.7 类别

Flowable 6.6.0 用户指南相关文档下载


《Flowable 6.6.0 BPMN用户指南》

1. 入门
2. 配置
3 The Flowable API
4 Flowable 6.6.0 BPMN用户指南 - (4)Spring集成
5 Spring Boot

6 部署

6.1 业务归档
6.2 以编程方式部署
6.3 外部资源
6.4 流程定义的版本控制
6.5 提供流程图
6.6 生成流程图
6.7 类别


有关Flowable的更多文档,参见:

《Flowable文档大全》


6.5 提供流程图

A process diagram image can be added to a deployment. This image will be stored in the Flowable repository and is accessible through the API. This image is also used to visualize the process in Flowable apps.

Suppose we have a process on our classpath, org/flowable/expenseProcess.bpmn20.xml that has a process key ‘expense’. The following naming conventions for the process diagram image apply (in this specific order):

可以将流程图添加到部署中。此图将存储在Flowable存储库中,并可通过API进行访问。此图还用于可视化Flowable应用程序中的流程。

假设我们在classpath上有一个流程,org/flowable/expenseProcess.bpmn20.xml,流程键为“expense”。流程图命名适用以下命名约定(按此特定顺序):

  • If an image resource exists in the deployment that has a name of the BPMN 2.0 XML file name concatenated with the process key and an image suffix, this image is used. In our example, this would be org/flowable/expenseProcess.expense.png (or .jpg/gif). In case you have multiple images defined in one BPMN 2.0 XML file, this approach makes most sense. Each diagram image will then have the process key in its file name.
  • If no such image exists, an image resource in the deployment matching the name of the BPMN 2.0 XML file is searched for. In our example this would be org/flowable/expenseProcess.png. Note that this means that every process definition defined in the same BPMN 2.0 file has the same process diagram image. In case there is only one process definition in each BPMN 2.0 XML file, this is obviously not a problem.

Example when deploying programmatically:

  • 如果部署中存在一个图像资源,其名称为BPMN 2.0 XML文件名,加上流程键,再加图像后缀,则使用此图像。在我们的示例中,这将是org/flowable/expenseProcess.expense.png(或.jpg/gif)。如果在一个BPMN 2.0 XML文件中定义了多个图像,那么这种方法最有意义。然后,每个流程图图像的文件名中都会有流程键。
  • 如果不存在这样的图像,则在部署中搜索与BPMN 2.0 XML文件名匹配的图像资源。在我们的示例中,这将是org/flowable/expenseProcess.png。 请注意,这意味着在同一个BPMN 2.0文件中定义的每个流程定义都具有相同的流程图。如果每个BPMN 2.0 XML文件中只有一个流程定义,这显然不是问题。

以编程方式部署时的示例:

repositoryService.createDeployment()
  .name("expense-process.bar")
  .addClasspathResource("org/flowable/expenseProcess.bpmn20.xml")
  .addClasspathResource("org/flowable/expenseProcess.png")
  .deploy();

The image resource can be retrieved through the API afterwards:

之后可以通过API检索图像资源:

ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
  .processDefinitionKey("expense")
  .singleResult();

String diagramResourceName = processDefinition.getDiagramResourceName();
InputStream imageStream = repositoryService.getResourceAsStream(
    processDefinition.getDeploymentId(), diagramResourceName);

6.6 生成流程图

If no image is provided in the deployment, as described in the previous section, the Flowable engine will generate a process diagram image if the process definition contains the necessary ‘diagram interchange’ information.

The resource can be retrieved in exactly the same way as when an image is provided in the deployment.

如果部署中没有提供图像(如前一节所述),那么如果流程定义包含必需的“图交换”(diagram interchange)信息,则Flowable引擎将生成流程图图像。

可以使用与在部署中提供图像时完全相同的方式检索资源。
在这里插入图片描述

If, for some reason, it’s not necessary or desirable to generate a diagram during deployment, the isCreateDiagramOnDeploy property can be set on the process engine configuration:

如果出于某种原因,不需要或不希望在部署期间生成流程图,则可以在流程引擎配置上设置isCreateDiagramOnDeploy属性:

<property name="createDiagramOnDeploy" value="false" />

此时就不会生成流程图了。

6.7 类别

Both deployments and process definitions have user-defined categories. The process definition category is initialized with the value of the targetNamespace attribute in the BPMN XML: <definitions … targetNamespace=“yourCategory” …

The deployment category can also be specified in the API like this:

部署和流程定义都有用户定义的类别。流程定义类别是用BPMN XML中targetNamespace属性的值初始化的:

<definitions 
	... 
	targetNamespace="yourCategory" 
	...
</definitions>

也可以在API中指定部署类别,如下所示:

repositoryService
    .createDeployment()
    .category("yourCategory")
    ...
    .deploy();


培训视频推荐

CSDN上提供了Flowable 6.6.0的系列培训视频课程,欢迎有兴趣的朋友前往学习。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

月满闲庭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值