概述
Process builder是Delmia Apriso中主要的业务流程管理工具,也是DELMIA更广泛的Apriso制造运营管理解决方案的核心应用程序,Process Builder允许使用屏幕流管理设计方法和实体(如项目、屏幕、布局、视图和操作(函数))创作用户界面和业务逻辑。该应用程序能够快速方便地管理和修改开发的设计,使您能够根据需要随时更改业务流程。由于增强了对可重用性的支持,以前开发的逻辑可以在新的设计中快速重用。
作为Apriso开发系列的结束篇,本文介绍开发结束后的打包和部署GPM模块。
什么是GPM
Global Process Manager (GPM)是一个DELMIA Apriso模块,它可以“开箱即用”地传输DELMIA Apriso实体和其他项目类型。使用此应用程序后,部署变得快速、可管理且可靠,并支持单生产和多生产服务器环境。
GPM也提供了控制台命令行模式,命令行模式是为管理员管理批量部署的设计。可以为包部署的执行编写脚本进行批量部署,命令行参数详见:http://[ServerName]/apriso/Help/en-us/GlobalProcessManager/index.htm#Command_Line_Parameters.htm?TocPath=Command%2520Line%2520Mode%257C_____2。
Site和COE
GPM有COE和Site两种授权,只有在完成授权注册后才能连接目标服务,
在本地发布状态,可以使用本地发布仪表板查询位于此服务器上的所有项目,并包括它们的名称、修订版本和构建号(最近部署在服务器上的包)
COE模式下提供全局部署视图Global Deployment View,提供全局监视和分析每个工厂、每个区域等的部署状态的能力。它是一组仪表板屏幕,显示部署状态和在一个中心位置聚合数据的机制。
全局部署视图使用消息队列向主服务器发送通知(包部署、目标服务器操作)。在主服务器不可用的情况下,消息在无效状态之前保持6天。无效消息将被丢弃。
全局部署视图在更改被监视环境的配置设置时使用实时远程处理。
详细使用方法详见http://[ServerName]/apriso/Help/en-us/GlobalProcessManager/index.htm#Global_Deployment_View.htm?TocPath=Global%2520Deployment%2520View%257CGlobal%2520Deployment%2520Overview%257C_____0
发布顺序
实体和GAC组件等一旦将它们添加到项目的内容中,就会根据它们之间的依赖关系为这些项建立正确的传输顺序,最不依赖的项首先出现。发布顺序(从上向下箭头所示)在“发布状态”Deployment Status选项卡中可见。
在“发布状态”标签页中,通过鼠标右键对相应的实体进行删除、发布等操作,详见http://[ServerName]/apriso/Help/en-us/GlobalProcessManager/index.htm#Deployment_Status_Tab.htm
包生成类型
GPM中有5种包生成类型
上图显示了三种包生成方法之间的差异。
发布选项
默认修订优先规则(PB项目不可用):
集群环境下的GPM
Global Process Manager支持多服务器和集群环境。要了解有关设置多服务器环境的详细信息,请参阅DELMIA Apriso高可用性安装指南,集群环境下树形结构中增加了一个Environment Nodes节点:
能够显示每个节点的当前状态以及最后更新结果:
如果由于某个节点上的GPM服务已停止而导致部署包失败,则在该节点上的GPM服务运行后,系统会自动尝试重新部署包。但是,如果包之前已经在节点上部署过,并且现在正在重新部署,那么一旦服务运行,系统就不会尝试再次部署它。在这种情况下,应该手动重新部署包。
大多数DELMIA Apriso服务由Cluster Manager管理。这意味着服务仅在一个节点上运行,如果服务停止,Cluster Manager将尝试重新启动该服务。如果失败,它将启动另一个功能正常的集群节点上的所有服务。但是,GPM服务不是由Cluster Manager管理的,因为它必须同时在所有节点上运行。
如果GPM停止工作,集群管理器不会自动重新启动GPM。如果GPM在活动集群节点上停止,则在手动启动服务之前,应用程序无法连接到该集群(并执行任何操作)。如果GPM在备用集群节点上停止,则应用程序使用主节点正常工作。在备节点上启动服务时,备用节点将更新最新的GPM包。
多数据库支持
可以生成一个包含数据库对象(不含数据的数据库表)的包,数据库视图、数据库包、数据库存储过程和数据库函数)和将在两种不同数据库类型上正确部署的SQL脚本。
要启用这个功能,需要在Configuration Manager中进行配置GPM Alternative Database
配置完成,并重新启动服务后,在GPM中增加数据库对象项或者SQL Scripts项时就会出现一个不同的额外选项:
举例Apriso在SQL Server环境下,并设置替代数据库为Oracle类型,设置后在Process builder开发时,就可以分别写入SQL Server和Oracle脚本或者对象。
在生成包时就会自动生成两个脚本,而不需要单独的为每种数据库类型进行添加。
Source Repository
可以将项目存储在SubVersion版本控制系统中。当生成部署包时,项被提交到源存储库。在存储库中存储项有两种方法:
第一步:添加Source Repository
在Console Root树形结构“Source Repository”右键点击“New Source Repository”,弹出“New Source Repository Properties”窗体
输入:存储库名称、SVN地址、用户、密码,点击OK,后会弹出是否需要新建SVN结构询问窗体:
点击Yes后,GPM自动才SVN服务器上建立相关目录结构。检查SVN服务器连接状态是否有效:
第二步:选择Source Repository
在新建项目或者PB Project项目的属性窗口中修改Source Repository
第三步:生成包体,检查SVN中文件生成情况
常见问题
问题 | 描述 |
---|---|
Operation or Process can get Active or Prototype status after deployment even if it is not valid | The TargetRevisionStatus flag is set to Prototype or Active as these entities are not validated by Global Process Manager during deployment. Perform one of the following actions:· Re-release the Operation or Process after deploying it (to validate it, can be done for entities in Prototype status only).·Include all the entity dependencies prior to its migration to assure its validity at the destination server. |
Unable find the configured directory for a file | There is a file in the package that is created from a predefined directory and that directory does not exist on the destination server (it is not predefined on the server). |
Problems with moving Reports/Labels | Reports and Labels are based on the REPORT table and use the ReportName column as their Global Unique Key. That might cause problems when they are moved between servers because there can be many different Reports with the same name. Moreover, there can be Reports and Labels that boast the same name. In situations where there is a Label with the same name as a Report being deployed, then that Label will be overridden by the Report. |
There is more than one entity or row in table with the same Global Unique Key column values | To deploy a package in this case, modify the values on the database to give them unique GUK columns. |
Referenced system table data or referenced entity does not exist on the destination database | To resolve this issue, deploy or add the referenced data on the server. |
Unable to import an entity because there is a cycle in the entity configuration between the referenced entities | The entity is incorrectly configured. To resolve this issue, modify the entity’s configuration to remove a cycle between referenced entities. |
The file cannot be deployed because the access to file or directory is denied | The Deployment Services Windows service does not have access to the file that is being deployed. |
Unable to remove component from GAC | The component cannot be removed from GAC. |
Unable to add *.dll to GAC | The GAC component cannot be deployed. |
Unable to save script file | The problem occurs when saving temporary files with SQL scripts to disk. Verify if the Deployment Service has rights to the C:\Temp\AprisoSQLScripts directory. |
Unable to deploy SQL script | You can find the reason for an unsuccessful deployment within the log files in the C:\Temp\AprisoSQLScripts directory on the server. |
Unable to read package data as it is in an older format | The file is of an incorrect format or does not contain DELMIA Apriso Global Process Manager package data. |
Unable to read package data | The message can appear during package deployment or redeployment or when a package is being sent or saved from the Package Repository. It indicates that data for that package is missing – the file with the required data has been removed or renamed. |
Unable to import the data because the entity with the same value of unique columns but different FUID already exists | Try to resolve the issue by deploying the package with the Skip deployed entities option disabled in the Deployment Options window. |
Package deployment results in timeout errors | In case of large size of a package, increase the sendTimeout and receiveTimeout parameters in the <drive>\Program Files\Dassault Systemes\DELMIA Apriso 2023\Website\CentralConfiguration\WcfClientConfiguration.xml and <drive>\Program Files\Dassault Systemes\DELMIA Apriso 2023\Services\Global Process Manager Services\FlexNetGlobalProcessManagerRemotingService.exe.config files. For details, refer to the Increasing Timeouts for Environment with a Large Amount of Data section of Process Builder Projects Implementation Guide. |
Package deployment and Operations regeneration failed | Deployment of packages that were generated in earlier DELMIA Apriso versions and contain incorrectly configured Operations might fail because the system will not regenerate such Operations. You need to deploy the packages manually on the upgraded environment without selecting the Auto regenerate Processes and Operations check box, validate the affected Project in Process Builder, resolve the errors, and generate and deploy the packages again with this check box selected. |
There are many Operations with the same code in destination database | Deployment of packages generated in DELMIA Apriso 2020 or earlier might fail if there are many Operations with the same code in the target database. Set the AllowUnresolvedOperationLinksDeployment key to "True" in the CentralConfiguration.xml file. GPM deploys all affected entities, but the links to Operations are removed. You need to manually relink the Operations after the package deployment. |
最佳实践
8. 在GPM SQL脚本编辑器中存储SQL脚本:将SQL脚本项目内容保存在GPM SQL脚本编辑器中,而不是保存在外部文件中。它将确保更容易访问脚本内容。
9. 将根操作Operation存储在单独的项目中:如果它们有循环调用,则将根操作存储在单独的项目中。否则,如果您将根操作与其依赖项放在一起,则在部署此类包时将遇到问题。
10. 只有当所有依赖对象都不在数据库中时,才能部署实体。对于该操作,必须部署所有被调用的子操作。GPM通过使用With Dependencies, Fully generated…选项来防止这种情况发生。
11. 如果后台活动(如后台作业调度操作、MI调用、Web服务调用)必须在项目上下文中完成,如
12. 更改模块之间的引用关系可能导致目标服务器上的项目定义不一致,需要谨慎处理
13. 创建专用的项目用于保存创建数据库对象的SQL脚本
14. 除非真的有必要,否则不要使用“从选择中生成”。热修复紧急发布只需要交付选定的项目时,比如修复程序打补丁时,可以使用“从选择中生成”生成。
15. 不要使用GPM向资源、工作中心等多个实体推送,因为这类实体引用了很多对象。这些实体位于许多相互引用的表中,这些实体也位于自定义表中,这是找到GPM之外的另一种方法的原因,有时,主数据量非常大(例如:仓库位置),这会导致GPM出现问题(等待时间长、错误)。
16. 在已经存在表的目标服务器上使用“SQL Script”实体部署表定义可能会导致数据丢失。这种情况必须由GPM中的特殊脚本实体来处理。该脚本应该执行以下操作:
17. 在目标服务器上部署系统参数可能会覆盖当前设置。为了防止这种情况,系统参数必须启用“运行时值特定于此Apriso实例”选项。但是对于第一次部署来说取消勾选“运行时值是特定于这个Apriso实例”也是可以的。它会使用源环境上设置值来初始化系统参数。
18. 如果目标上已经存在判定的GPM传输可能会导致数据丢失。目标服务器上的当前确定内容必须存储在临时表中。类似于对表的操作
19. 生产环境部署必须及时精确地计划,因为它意味着生产过程的中断,并且必须在计划时考虑其后果。客户可能会利用Apriso更新工厂的机会,在休息时间安排其他操作,如硬件升级、生产车间扫描仪更换、其他软件的安装/更新
20. 必要时需要准备单独的回滚GPM,用于回滚操作,如:
需要发布的包:
operation: Order.Start COM.1.1.003 (new default)
new stored procedure: AP_CONTAINER_Insert
回滚包 (在生产机上生成):
operation: Order.Start COM.1.1.002 (更新之前的版本)
current stored procedure: AP_CONTAINER_Insert
回滚后的状态
operation: Order.Start COM.1.1.002 (new default)
operation: Order.Start COM.1.1.003
previous version of stored procedure: AP_CONTAINER_Insert
21. 多工厂定制时可以有两种方式实现:一种是使用系统参数,一种是和工厂Facility特征来进行区分
22. 指定一名开发人员负责包的创建。如果很多用户使用GPM,就有出错的风险。