cancel
Showing results for 
Search instead for 
Did you mean: 

Deployment Strategy

rafaelduqueestr
Champ in-the-making
Champ in-the-making
Hi everyone,
I'm using activiti with spring and I have a dought about which is the best strategy for deployment process definitions.
Currently I'm using automatic deployment like:


@Configuration
public class ActivitiConfiguration {

    @Bean
    public SpringProcessEngineConfiguration processEngineConfiguration(DataSource dataSource,
                                                                       PlatformTransactionManager transactionManager,
                                                                       EntityManagerFactory entityManagerFactory) {
        SpringProcessEngineConfiguration engineConfiguration = new SpringProcessEngineConfiguration();
        engineConfiguration.setDataSource(dataSource);
        engineConfiguration.setTransactionManager(transactionManager);
        engineConfiguration.setJpaEntityManagerFactory(entityManagerFactory);
        engineConfiguration.setHistory(HistoryLevel.FULL.getKey());
        engineConfiguration.setDeploymentResources(deploymentResources());
        engineConfiguration.setDeploymentMode("single-resource");

        return engineConfiguration;
    }

    private Resource[] deploymentResources() {
        Resource[] processResource = new Resource[1];
        processResource[0] = new ClassPathResource("bpm/activiti/XPTOProcess.bpmn20.xml");
        return  processResource;
    }

    @Bean
    public ProcessEngine processEngine(SpringProcessEngineConfiguration springProcessEngineConfiguration,
                                       ApplicationContext applicationContext) throws Exception {
        ProcessEngineFactoryBean processEngineFactoryBean = new ProcessEngineFactoryBean();
        processEngineFactoryBean.setProcessEngineConfiguration(springProcessEngineConfiguration);
        processEngineFactoryBean.setApplicationContext(applicationContext);
        return processEngineFactoryBean.getObject();
    }
}

Every time I run the app in jboss a new version of definition process is created, even if any changes in XPTOProcess.bpmn20.xml.

How the activiti engine works with the differences between versions of definition process? (there is nothing about this in the user guide section 6.3)
10 REPLIES 10

rafaelduqueestr
Champ in-the-making
Champ in-the-making
"even if any changes in XPTOProcess.bpmn20.xml"
the correct would be
"even if it doesn't have any changes in XPTOProcess.bpmn20.xml"

rafaelduqueestr
Champ in-the-making
Champ in-the-making
When I was investiganting the activiti tables, I realized that the ACT_RE_PROCDEF has the following field: RESOURCE_NAME_. The content of this field is the absolute path of the xml definition process.
Every time the absolute path changes, the new version process is created. Is there any relationship between de RESOURCE_NAME_ and the logic of control when the activiti engine will create or not a new version process in the database?

jbarrez
Star Contributor
Star Contributor
Normally, the check for new deployments is done on the actual content of the process definiiton.

Im not following the 'RESOURCE_NAME_' thing. Do you have an example of what values are put in there and how they change between reboots?

rafaelduqueestr
Champ in-the-making
Champ in-the-making
Today i deployed the app 3 times in jboss, the result of ACT_RE_DEPLOYMENT table is:
[table]
[h]ID_[/h]
[h]NAME_[/h]
[h]CATEGORY_[/h]
[h]TENANT_ID_[/h]
[h]DEPLOY_TIME_[/h]
[tr]
[td]90001[/td]
[td]/opt/EAP-6.3.0/jboss-eap-6.3/standalone/tmp/vfs/temp/tempf01d1834114b430d/content-e2676ae7e0980aa3/WEB-INF/classes/bpm/activiti/ConselhoSuperiorProcess.bpmn20.xml[/td]
[td]null[/td]
[td]null[/td]
[td]16/06/15 12:14:43,575000000[/td]
[/tr]
[tr]
[td]92501[/td]
[td]/opt/EAP-6.3.0/jboss-eap-6.3/standalone/tmp/vfs/temp/tempf01d1834114b430d/content-5e7e313849c12188/WEB-INF/classes/bpm/activiti/ConselhoSuperiorProcess.bpmn20.xml[/td]
[td]null[/td]
[td]null[/td]
[td]16/06/15 12:16:32,704000000[/td]
[/tr]
[tr]
[td]97501[/td]
[td]/opt/EAP-6.3.0/jboss-eap-6.3/standalone/tmp/vfs/temp/tempf01d1834114b430d/content-9fb5292f8c0d0965/WEB-INF/classes/bpm/activiti/ConselhoSuperiorProcess.bpmn20.xml[/td]
[td]null[/td]
[td]null[/td]
[td]16/06/15 14:07:12,990000000[/td]
[/tr]
[/table]

And the content of bpm xml is the same:


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
    <process id="conselhoSuperiorProcess" isExecutable="true">
        <extensionElements>
            <activiti:executionListener expression="${documentoRecebidoFacade.validar(idDocumento)}" event="start" />
        </extensionElements>
        <startEvent id="startProcess" name="Iniciar Análises"></startEvent>
        <serviceTask id="bloquearDocumento" name="Bloquear Documento" activiti:expression="${documentoAnaliseFacade.bloquearDocumento(idDocumento)}" activiti:resultVariableName="documento"></serviceTask>
        <userTask id="analisarComplementacaoDados" name="Analisar Complementação de Dados">
            <extensionElements>
                <activiti:taskListener event="complete" expression="${documentoRecebidoFacade.validar(idDocumento)}"></activiti:taskListener>
            </extensionElements>
        </userTask>
        <userTask id="enviarParaDistribuicao" name="Enviar para Distribuição"></userTask>
        <endEvent id="endProcess"></endEvent>
        <userTask id="analisarPrevencao" name="Analisar Prevenção">
            <extensionElements>
                <activiti:taskListener event="complete" expression="${documentoRecebidoFacade.validar(idDocumento)}"></activiti:taskListener>
            </extensionElements>
        </userTask>
        <parallelGateway id="parallelGatewayAnalisesFim"></parallelGateway>
        <parallelGateway id="parallelGatewayAnalisesInicio"></parallelGateway>
        <userTask id="analisarImpedimento" name="Analisar Impedimento">
            <extensionElements>
                <activiti:taskListener event="complete" expression="${documentoRecebidoFacade.validar(idDocumento)}"></activiti:taskListener>
            </extensionElements>
        </userTask>
        <sequenceFlow id="sequenceFlowAnalisarComplementacaoDadosOut" sourceRef="analisarComplementacaoDados" targetRef="parallelGatewayAnalisesFim"></sequenceFlow>
        <sequenceFlow id="sequenceFlowAnalisarComplementacaoDadosIn" sourceRef="parallelGatewayAnalisesInicio" targetRef="analisarComplementacaoDados"></sequenceFlow>
        <sequenceFlow id="sequenceFlowAnalisarPrevencaoIn" sourceRef="parallelGatewayAnalisesInicio" targetRef="analisarPrevencao"></sequenceFlow>
        <sequenceFlow id="sequenceFlowAnalisarImpedimentoIn" sourceRef="parallelGatewayAnalisesInicio" targetRef="analisarImpedimento"></sequenceFlow>
        <sequenceFlow id="sequenceFlowBloquearDocumentoIn" sourceRef="startProcess" targetRef="bloquearDocumento"></sequenceFlow>
        <sequenceFlow id="sequenceFlowBloquearDocumentoOut" sourceRef="bloquearDocumento" targetRef="parallelGatewayAnalisesInicio"></sequenceFlow>
        <sequenceFlow id="sequenceFlowAnalisarPrevencaoOut" sourceRef="analisarPrevencao" targetRef="parallelGatewayAnalisesFim"></sequenceFlow>
        <sequenceFlow id="sequenceFlowAnalisarImpedimentoOut" sourceRef="analisarImpedimento" targetRef="parallelGatewayAnalisesFim"></sequenceFlow>
        <sequenceFlow id="sequenceFlowEnviarParaDistribuicaoIn" sourceRef="parallelGatewayAnalisesFim" targetRef="enviarParaDistribuicao"></sequenceFlow>
        <sequenceFlow id="sequenceFlowEnviarParaDistribuicaoOut" sourceRef="enviarParaDistribuicao" targetRef="endProcess"></sequenceFlow>
    </process>
    <bpmndi:BPMNDiagram id="BPMNDiagram_conselhoSuperiorProcess">
        <bpmndi:BPMNPlane bpmnElement="conselhoSuperiorProcess" id="BPMNPlane_conselhoSuperiorProcess">
            <bpmndi:BPMNShape bpmnElement="startProcess" id="BPMNShape_startProcess">
                <omgdc:Bounds height="30.0" width="30.0" x="90.0" y="209.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="bloquearDocumento" id="BPMNShape_bloquearDocumento">
                <omgdc:Bounds height="80.0" width="100.0" x="195.0" y="184.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="analisarComplementacaoDados" id="BPMNShape_analisarComplementacaoDados">
                <omgdc:Bounds height="80.0" width="100.0" x="435.0" y="60.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="enviarParaDistribuicao" id="BPMNShape_enviarParaDistribuicao">
                <omgdc:Bounds height="80.0" width="100.0" x="675.0" y="184.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="endProcess" id="BPMNShape_endProcess">
                <omgdc:Bounds height="28.0" width="28.0" x="840.0" y="210.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="analisarPrevencao" id="BPMNShape_analisarPrevencao">
                <omgdc:Bounds height="80.0" width="100.0" x="435.0" y="184.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="parallelGatewayAnalisesFim" id="BPMNShape_parallelGatewayAnalisesFim">
                <omgdc:Bounds height="40.0" width="40.0" x="585.7159423828125" y="204.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="parallelGatewayAnalisesInicio" id="BPMNShape_parallelGatewayAnalisesInicio">
                <omgdc:Bounds height="40.0" width="40.0" x="345.0" y="204.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="analisarImpedimento" id="BPMNShape_analisarImpedimento">
                <omgdc:Bounds height="80.0" width="100.0" x="435.0" y="300.0"></omgdc:Bounds>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowAnalisarComplementacaoDadosOut" id="BPMNEdge_sequenceFlowAnalisarComplementacaoDadosOut">
                <omgdi:waypoint x="535.0" y="100.0"></omgdi:waypoint>
                <omgdi:waypoint x="606.0" y="100.0"></omgdi:waypoint>
                <omgdi:waypoint x="605.7616534132751" y="204.04571103046257"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowAnalisarImpedimentoOut" id="BPMNEdge_sequenceFlowAnalisarImpedimentoOut">
                <omgdi:waypoint x="535.0" y="340.0"></omgdi:waypoint>
                <omgdi:waypoint x="605.7159423828125" y="340.0"></omgdi:waypoint>
                <omgdi:waypoint x="605.7159423828125" y="244.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowEnviarParaDistribuicaoOut" id="BPMNEdge_sequenceFlowEnviarParaDistribuicaoOut">
                <omgdi:waypoint x="775.0" y="224.0"></omgdi:waypoint>
                <omgdi:waypoint x="840.0" y="224.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowBloquearDocumentoOut" id="BPMNEdge_sequenceFlowBloquearDocumentoOut">
                <omgdi:waypoint x="295.0" y="224.0"></omgdi:waypoint>
                <omgdi:waypoint x="345.0" y="224.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowAnalisarPrevencaoOut" id="BPMNEdge_sequenceFlowAnalisarPrevencaoOut">
                <omgdi:waypoint x="535.0" y="224.0"></omgdi:waypoint>
                <omgdi:waypoint x="585.7159423828125" y="224.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowAnalisarImpedimentoIn" id="BPMNEdge_sequenceFlowAnalisarImpedimentoIn">
                <omgdi:waypoint x="365.5" y="243.5"></omgdi:waypoint>
                <omgdi:waypoint x="365.5" y="340.0"></omgdi:waypoint>
                <omgdi:waypoint x="435.0" y="340.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowEnviarParaDistribuicaoIn" id="BPMNEdge_sequenceFlowEnviarParaDistribuicaoIn">
                <omgdi:waypoint x="625.7159423828125" y="224.0"></omgdi:waypoint>
                <omgdi:waypoint x="675.0" y="224.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowAnalisarComplementacaoDadosIn" id="BPMNEdge_sequenceFlowAnalisarComplementacaoDadosIn">
                <omgdi:waypoint x="365.0" y="204.0"></omgdi:waypoint>
                <omgdi:waypoint x="365.0" y="100.0"></omgdi:waypoint>
                <omgdi:waypoint x="435.0" y="100.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowBloquearDocumentoIn" id="BPMNEdge_sequenceFlowBloquearDocumentoIn">
                <omgdi:waypoint x="120.0" y="224.0"></omgdi:waypoint>
                <omgdi:waypoint x="195.0" y="224.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sequenceFlowAnalisarPrevencaoIn" id="BPMNEdge_sequenceFlowAnalisarPrevencaoIn">
                <omgdi:waypoint x="385.0" y="224.0"></omgdi:waypoint>
                <omgdi:waypoint x="435.0" y="224.0"></omgdi:waypoint>
            </bpmndi:BPMNEdge>
        </bpmndi:BPMNPlane>
    </bpmndi:BPMNDiagram>
</definitions>

The xml file is 'UTF-8' and the database NLS_CHARSET is 'WE8ISO8859P1'. Could it be a problem?

trademak
Star Contributor
Star Contributor
I think the logic also checks if the file path is still the same. If the file path changed, like in your case, it will do a new deployment. Maybe we should reconsider this logic and only deploy a new version when the content has changed independent of the file path. If you agree, then please create a JIRA issue.

Best regards,

rafaelduqueestr
Champ in-the-making
Champ in-the-making
Yes, i agrree and i will create a JIRA issue, highlighting this post.
So, I ask again, what is the best way to control the deployment of definitions process in production mode? The another post Joram said the activiti explorer isn't a product for production, only for tests (for this I decided to use the automatic deploy as a solution).

rafaelduqueestr
Champ in-the-making
Champ in-the-making
Tijs,
where is the Activiti JIRA? The community page ( http://activiti.org/community.html ) is redirecting to codehaus but the codehaus services have been terminated ( https://www.codehaus.org/termination/ ).

jbarrez
Star Contributor
Star Contributor

rafaelduqueestr
Champ in-the-making
Champ in-the-making
Joram, what is the best issue type for this report? Bug or Improvement?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.