flowable 6.7版本新功能

Posted 分享牛

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了flowable 6.7版本新功能相关的知识,希望对你有一定的参考价值。

flowable 6.7版本新增功能如下:本文主要对比的是flowable 6.5-flowable 6.7.x区间的功能。

1、兼容其他流程引擎框架(新增bpm标准元素)

新增BPM xsd属性,可以兼容Camunda框架属性。
  比如引入了
  exporter="pangubpm.com" exporterVersion="5.1.0-dev" 。       
targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL"
             xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd

2、扩展了引入了商业产品组件

          <signavio:signavioMetaData metaKey="bgcolor" metaValue="#FFFFCC"/>
            <signavio:signavioMetaData metaKey="risklevel" metaValue=""/>
            <signavio:signavioMetaData metaKey="externaldocuments" metaValue=""/>

3、内核隐藏增强

1、内置了ObjectMapper

 objectMapper = new ObjectMapper();
            objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);

2、内置了一系列工具集合

 if (processInstanceHelper == null) 
            processInstanceHelper = new ProcessInstanceHelper();
        
        if (listenerNotificationHelper == null) 
            listenerNotificationHelper = new ListenerNotificationHelper();
        
        if (formHandlerHelper == null) 
            formHandlerHelper = new FormHandlerHelper();
        

3、增强webservice服务

  DefaultXMLImporterFactory defaultListenerFactory = new DefaultXMLImporterFactory();
            wsWsdlImporterFactory = defaultListenerFactory;

3、增强webservice服务

  DefaultXMLImporterFactory defaultListenerFactory = new DefaultXMLImporterFactory();
            wsWsdlImporterFactory = defaultListenerFactory;

4、历史数据处理可配置

historyConfigurationSettings = new DefaultHistoryConfigurationSettings(this);

5、租户ID可以修复

  public void initChangeTenantIdManager() 
        if (changeTenantEntityTypes == null) 
            changeTenantEntityTypes = new LinkedHashSet<>();
        
        changeTenantEntityTypes.addAll(BpmnChangeTenantIdEntityTypes.RUNTIME_TYPES);

        if (isDbHistoryUsed) 
            changeTenantEntityTypes.addAll(BpmnChangeTenantIdEntityTypes.HISTORIC_TYPES);
        

        if (changeTenantIdManager == null) 
            changeTenantIdManager = new MyBatisChangeTenantIdManager(commandExecutor, ScopeTypes.BPMN, changeTenantEntityTypes);
        
    

6、流程跳转可自定义(复杂的场景还是不可以)

public void initDynamicStateManager() 
        if (dynamicStateManager == null) 
            dynamicStateManager = new DefaultDynamicStateManager();
        
    

7、增加处理人拦截器,业务可以监控节点任务处理人的变化

 public void initIdentityLinkInterceptor() 
        if (identityLinkInterceptor == null) 
            identityLinkInterceptor = new DefaultIdentityLinkInterceptor();
        
    

8、增加处理人拦截器,业务可以监控节点任务处理人的变化

/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.engine.impl.interceptor;

import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
import org.flowable.engine.impl.util.CommandContextUtil;
import org.flowable.engine.impl.util.IdentityLinkUtil;
import org.flowable.engine.interceptor.IdentityLinkInterceptor;
import org.flowable.identitylink.api.IdentityLinkType;
import org.flowable.identitylink.service.impl.persistence.entity.IdentityLinkEntity;
import org.flowable.task.api.Task;
import org.flowable.task.service.impl.persistence.entity.TaskEntity;

public class DefaultIdentityLinkInterceptor implements IdentityLinkInterceptor 

    @Override
    public void handleCompleteTask(TaskEntity task) 
        if (Authentication.getAuthenticatedUserId() != null && task.getProcessInstanceId() != null) 
            ExecutionEntity processInstanceEntity = CommandContextUtil.getExecutionEntityManager().findById(task.getProcessInstanceId());
            IdentityLinkUtil.createProcessInstanceIdentityLink(processInstanceEntity,
                    Authentication.getAuthenticatedUserId(), null, IdentityLinkType.PARTICIPANT);
        
    
    
    @Override
    public void handleAddIdentityLinkToTask(TaskEntity taskEntity, IdentityLinkEntity identityLinkEntity) 
        addUserIdentityLinkToParent(taskEntity, identityLinkEntity.getUserId());
    
    
    @Override
    public void handleAddAssigneeIdentityLinkToTask(TaskEntity taskEntity, String assignee) 
        addUserIdentityLinkToParent(taskEntity, assignee);
    
    
    @Override
    public void handleAddOwnerIdentityLinkToTask(TaskEntity taskEntity, String owner) 
        addUserIdentityLinkToParent(taskEntity, owner);
    

    @Override
    public void handleCreateProcessInstance(ExecutionEntity processInstanceExecution) 
        String authenticatedUserId = Authentication.getAuthenticatedUserId();
        if (authenticatedUserId != null) 
            IdentityLinkUtil.createProcessInstanceIdentityLink(processInstanceExecution, authenticatedUserId, null, IdentityLinkType.STARTER);
        
    
    
    @Override
    public void handleCreateSubProcessInstance(ExecutionEntity subProcessInstanceExecution, ExecutionEntity superExecution) 
        String authenticatedUserId = Authentication.getAuthenticatedUserId();
        if (authenticatedUserId != null) 
            IdentityLinkUtil.createProcessInstanceIdentityLink(subProcessInstanceExecution, authenticatedUserId, null, IdentityLinkType.STARTER);
        
    
    
    protected void addUserIdentityLinkToParent(Task task, String userId) 
        if (userId != null && task.getProcessInstanceId() != null) 
            ExecutionEntity processInstanceEntity = CommandContextUtil.getExecutionEntityManager().findById(task.getProcessInstanceId());
            for (IdentityLinkEntity identityLink : processInstanceEntity.getIdentityLinks()) 
                if (identityLink.isUser() && identityLink.getUserId().equals(userId) && IdentityLinkType.PARTICIPANT.equals(identityLink.getType())) 
                    return;
                
            
            
            IdentityLinkUtil.createProcessInstanceIdentityLink(processInstanceEntity, userId, null, IdentityLinkType.PARTICIPANT);
        
    

9、表单字段处理器(商业版本产品的接口)

 public void initFormFieldHandler() 
        if (this.formFieldHandler == null) 
            this.formFieldHandler = new DefaultFormFieldHandler();
        
    

10、定期处理历史数据

 public void initHistoryCleaningManager() 
        if (historyCleaningManager == null) 
            historyCleaningManager = new DefaultHistoryCleaningManager(this);
        
    

4、ProcessEngine 引擎增强

新增的门面接口如下:

public interface ProcessEngine extends Engine 

    /** the version of the flowable library */
    String VERSION = FlowableVersions.CURRENT_VERSION;

    /**
     * Starts the executors (async and async history), if they are configured to be auto-activated.
     */
    void startExecutors();


    ProcessMigrationService getProcessMigrationService();

    ProcessEngineConfiguration getProcessEngineConfiguration();

5、商业引擎api增加到开源版本,具体实现没开源在商业版本中的类

1、ServiceInvoker 外部服务调用
2、form接口
3、高级人员组件
4、国际化、多语言组件
5、流程引擎泳道自动布局包
6.等等

6、兼容性问题

这个版本目前不在彻底兼容activiti。

infopath地址:https://gitee.com/pangu-dm/infopath

上面文章来自盘古BPM研究院:http://vue.pangubpm.com/
文章翻译提交:https://github.com/qiudaoke/flowable-userguide
了解更多文章可以关注微信公众号:

以上是关于flowable 6.7版本新功能的主要内容,如果未能解决你的问题,请参考以下文章

Magicodes.WeiChat——V3.0(多租户)版本发布

Flowable入门系列文章93 - 部署 01

X-Admin&ABP框架开发-版本管理

vCenter Server 6.7 Update 2中的新功能

如何使用流程 中的 DataObject 并为流程设置租户

如何使用流程 中的 DataObject 并为流程设置租户