Camunda: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 231: Line 231:
|-
|-
!scope="col"| SN !!scope="col"| Table !!scope="col"| Keys
!scope="col"| SN !!scope="col"| Table !!scope="col"| Keys
|rowspan="11"|
|rowspan="21"|
!scope="col"| SN !!scope="col"| Table !!scope="col"| Keys
|rowspan="11"|
!scope="col"| SN !!scope="col"| Table !!scope="col"| Keys
!scope="col"| SN !!scope="col"| Table !!scope="col"| Keys
|-
|-
0 || <code>act_ge_bytearray</code> || <code>id_, deployment_id_</code> || 10 || <code>act_hi_taskinst</code> || <code>id_</code> || 20 || <code>act_ru_meter_log</code> || <code>id_</code>
00 || <code>act_ge_bytearray</code> || <code>id_, deployment_id_</code> || 20 || <code>act_ru_meter_log</code> || <code>id_</code>
|-
|  01 || <code>act_ge_property</code> || <code>id_</code> || 21 || <code>act_ru_task</code> || <code>id_, execution_id_, proc_inst_id_, proc_def_id_, case_execution_id_, case_def_id_</code>
|-
|  02 || <code>act_ge_schema_log</code> || <code>id_</code> || 22 || <code>act_ru_variable</code> || <code>id_, execution_id_, proc_inst_id_, case_execution_id_, case_inst_id_, batch_id_, bytearray_id_</code>
|-
|  03 || <code>act_hi_actinst</code> || <code>id_</code> || 23 || <code></code> || <code></code>
|-
|  04 || <code>act_hi_dec_in</code> || <code>id_</code> || 24 || <code></code> || <code></code>
|-
|  05 || <code>act_hi_dec_out</code> || <code>id_</code> || 25 || <code></code> || <code></code>
|-
|  06 || <code>act_hi_decinst</code> || <code>id_</code> || 26 || <code></code> || <code></code>
|-
|  07 || <code>act_hi_detail</code> || <code>id_</code> || 27 || <code></code> || <code></code>
|-
|  08 || <code>act_hi_op_log</code> || <code>id_</code> || 28 || <code></code> || <code></code>
|-
|  09 || <code>act_hi_procinst</code> || <code>id_</code> || 29 || <code></code> || <code></code>
|-
| 10 || <code>act_hi_taskinst</code> || <code>id_</code> || 30 || <code></code> || <code></code>
|-
|-
|  1 || <code>act_ge_property</code> || <code>id_</code> || 11 || <code>act_hi_varinst</code> || <code>id_</code> || 21 || <code>act_ru_task</code> || <code>id_, execution_id_, proc_inst_id_, proc_def_id_, case_execution_id_, case_def_id_</code>
| 11 || <code>act_hi_varinst</code> || <code>id_</code> || 31 || <code></code> || <code></code>
|-
|-
|  2 || <code>act_ge_schema_log</code> || <code>id_</code> || 12 || <code>act_id_group</code> || <code>id_</code> || 22 || <code>act_ru_variable</code> || <code>id_, execution_id_, proc_inst_id_, case_execution_id_, case_inst_id_, batch_id_, bytearray_id_</code>
| 12 || <code>act_id_group</code> || <code>id_</code> || 32 || <code></code> || <code></code>
|-
|-
|  3 || <code>act_hi_actinst</code> || <code>id_</code> || 13 || <code>act_id_user</code> || <code>id_</code> || 23 || <code></code> || <code></code>
| 13 || <code>act_id_user</code> || <code>id_</code> || 33 || <code></code> || <code></code>
|-
|-
|  4 || <code>act_hi_dec_in</code> || <code>id_</code> || 14 || <code>act_re_decision_def</code> || <code>id_, dec_req_id_</code> || 24 || <code></code> || <code></code>
| 14 || <code>act_re_decision_def</code> || <code>id_, dec_req_id_</code> || 34 || <code></code> || <code></code>
|-
|-
|  5 || <code>act_hi_dec_out</code> || <code>id_</code> || 15 || <code>act_re_decision_req_def</code> || <code>id_</code> || 25 || <code></code> || <code></code>
| 15 || <code>act_re_decision_req_def</code> || <code>id_</code> || 35 || <code></code> || <code></code>
|-
|-
|  6 || <code>act_hi_decinst</code> || <code>id_</code> || 16 || <code>act_re_deployment</code> || <code>id_</code> || 26 || <code></code> || <code></code>
| 16 || <code>act_re_deployment</code> || <code>id_</code> || 36 || <code></code> || <code></code>
|-
|-
|  7 || <code>act_hi_detail</code> || <code>id_</code> || 17 || <code>act_re_procdef</code> || <code>id_</code> || 27 || <code></code> || <code></code>
| 17 || <code>act_re_procdef</code> || <code>id_</code> || 37 || <code></code> || <code></code>
|-
|-
|  8 || <code>act_hi_op_log</code> || <code>id_</code> || 18 || <code>act_ru_authorization</code> || <code>id_</code> || 28 || <code></code> || <code></code>
| 18 || <code>act_ru_authorization</code> || <code>id_</code> || 38 || <code></code> || <code></code>
|-
|-
|  9 || <code>act_hi_procinst</code> || <code>id_</code> || 19 || <code>act_ru_execution</code> || <code>id_, proc_inst_id_, parent_id_, proc_def_id_, super_exec_</code> || 29 || <code></code> || <code></code>
| 19 || <code>act_ru_execution</code> || <code>id_, proc_inst_id_, parent_id_, proc_def_id_, super_exec_</code> || 39 || <code></code> || <code></code>
|}
|}



Revision as of 16:19, 26 February 2024

sudo mkdir -p /opt/ide
sudo wget -cq https://downloads.camunda.cloud/release/camunda-modeler/5.7.0/camunda-modeler-5.7.0-linux-x64.tar.gz -P /opt/ide
sudo tar -xzf /opt/ide/camunda-modeler-5.7.0-linux-x64.tar.gz -C /opt/ide
sudo rm  -rf  /opt/ide/camunda-modeler-5.7.0-linux-x64.tar.gz

sudo wget -cq https://camunda.com/wp-content/uploads/2022/02/Secondary-Logo_Rounded-Black-300x300.png\
 -O /opt/ide/camunda-modeler-5.7.0-linux-x64/camunda-modeler.png
cat << EOF | sudo tee /usr/share/applications/CamundaModeler.desktop >>/dev/null
[Desktop Entry]
Name=Camunda Modeler 5
Comment=SpringSource Tool Suite 4
Exec=/opt/ide/camunda-modeler-5.7.0-linux-x64/camunda-modeler
Icon=/opt/ide/camunda-modeler-5.7.0-linux-x64/camunda-modeler.png
StartupNotify=true
Terminal=false
Type=Application
Keywords=Camunda,Modeler,BPMN,IDE,Development
Categories=Development;IDE;BPMN;
EOF

docker-compose.yml

version: '3.4'

services:
  academia-poc:
    image: camunda/camunda-bpm-platform:run-latest
    container_name: academia_poc
    restart: always
    ports:
      - 127.0.0.1:15010:8080
    volumes:
      - ./h2:/app/camunda-h2-default
      - ./forms:/app/client/xc-tasklist/forms
docker-compose logs -ft
docker-compose up -d
docker-compose down

camunda.dev.chorke.org

vim /etc/hosts
#127.0.0.1       camuda.dev.chorke.org

mkdir /var/log/apache2/camuda.dev.chorke.org

cat <<'EOF' > /etc/apache2/sites-enabled/00-camuda.dev.chorke.org.conf
<VirtualHost *:80>
    ProxyRequests Off
    ProxyPreserveHost On
    AllowEncodedSlashes Off

    ServerAdmin [email protected]
    ServerAlias camunda.dev.chorke.org
    ServerName www.camunda.dev.chorke.org

    <Location />
        Order Allow,Deny
        Allow from all
        RequestHeader set "Host" "camunda.dev.chorke.org"
        ProxyPass http://127.0.0.1:15010/ nocanon
        ProxyPassReverse http://127.0.0.1:15010/
    </Location>

    ErrorLog ${APACHE_LOG_DIR}/camunda.dev.chorke.org/error.log
    CustomLog ${APACHE_LOG_DIR}/camunda.dev.chorke.org/access.log combined
</VirtualHost>
EOF

a2enmod headers
sudo apachectl -t
sudo systemctl restart apache2
sudo systemctl daemon-reload
http://camunda.dev.chorke.org/engine-rest/process-definition?latestVersion=true
http://camunda.dev.chorke.org/engine-rest/task?processInstanceId={processID}&withoutTenantId=false&includeAssignedTasks=false&assigned=false&unassigned=false&withoutDueDate=false&withCandidateGroups=false&withoutCandidateGroups=false&withCandidateUsers=false&withoutCandidateUsers=false&active=false&suspended=false&variableNamesIgnoreCase=false&variableValuesIgnoreCase=false

http://camunda.dev.chorke.org/camunda/app/cockpit/default/#/dashboard
http://camunda.dev.chorke.org/camunda/app/welcome/default/#!/welcome
http://camunda.dev.chorke.org/camunda/app/tasklist/default/#/
http://camunda.dev.chorke.org/camunda/app/admin/default/#/
http://camunda.dev.chorke.org/

http://camunda.dev.chorke.org/camunda/swaggerui/#/Process%20Definition/getProcessDefinitions
http://camunda.dev.chorke.org/camunda/engine-rest/deployment/create
http://camunda.dev.chorke.org/camunda/app/tasklist/default/
http://camunda.dev.chorke.org/camunda/engine-rest/
http://camunda.dev.chorke.org/camunda/swaggerui/
http://dev.chorke.org/services/data/swaggerui/
http://dev.chorke.org/camunda/app/
http://camunda.dev.chorke.org/ui/
http://camunda.dev.chorke.org/

Invoking Java

<repositories>
    <repository>
        <id>camunda-bpm-artifactory</id>
        <name>camunda-bpm-artifactory</name>
        <url>https://camunda.jfrog.io/artifactory/public/</url>
    </repository>
</repositories>

Camunda Tomcat

groupadd tomcat
useradd -s /bin/false -g tomcat -d /opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52/ tomcat
chown -R tomcat /opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52/{webapps,work,temp,logs}
chgrp -R tomcat /opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52/
chmod -R g+r /opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52/conf
chmod g+x /opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52/conf
vim /etc/systemd/system/camunda.service
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
Before=httpd.service

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/java-8-openjdk-armhf/jre
Environment=CATALINA_PID=/opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52
Environment=CATALINA_BASE=/opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52/bin/startup.sh
ExecStop=/opt/camunda/camunda-bpm-tomcat-7.16.0/server/apache-tomcat-9.0.52/bin/shutdown.sh

User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target
systemctl status camunda.service
systemctl enable camunda.service
systemctl start  camunda.service

Netflix Eureka

Lookup for Version
https://www.baeldung.com/spring-cloud-netflix-eureka
https://github.com/eugenp/tutorials/tree/master/spring-cloud/spring-cloud-eureka

Lookup for Dependency
https://github.com/eugenp/tutorials/blob/master/parent-boot-2/pom.xml
https://github.com/eugenp/tutorials/blob/master/spring-cloud/pom.xml
https://github.com/eugenp/tutorials/blob/master/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml
<version.chorke.spring.cloud>2021.0.0</version.chorke.spring.cloud>
<version.chorke.spring.boot>2.6.3</version.chorke.spring.boot>

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-dependencies</artifactId>
    <version>${version.chorke.spring.cloud}</version>
    <scope>import</scope>
    <type>pom</type>
</dependency>

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>

Export BPMN

package io.xpresscover.services.camunda

import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Service
import org.camunda.bpm.engine.RuntimeService
import org.camunda.bpm.engine.ProcessEngine
import org.slf4j.LoggerFactory
import java.io.BufferedReader

@Service
class ExportProcessModel(
    var runtimeService: RuntimeService,
    var processEngine: ProcessEngine
) {
    val log = LoggerFactory.getLogger(ExportProcessModel::class.java)

    @Scheduled(fixedDelay = 15000, initialDelay = 15000)
    fun export() {
        val mutableList = processEngine.getRepositoryService().createProcessDefinitionQuery().list()
        for (processDefinition in mutableList) {
            val inputStream = processEngine.getRepositoryService().getProcessModel(processDefinition.id)
            val bufferedReader = BufferedReader(inputStream.reader())
            var xml: String

            try {
                xml = bufferedReader.readText()
                log.info("Model: \n{}", xml)
            } finally {
                bufferedReader.close()
            }
        }
    }
}

Workflow Tables

SN Table Keys SN Table Keys
00 act_ge_bytearray id_, deployment_id_ 20 act_ru_meter_log id_
01 act_ge_property id_ 21 act_ru_task id_, execution_id_, proc_inst_id_, proc_def_id_, case_execution_id_, case_def_id_
02 act_ge_schema_log id_ 22 act_ru_variable id_, execution_id_, proc_inst_id_, case_execution_id_, case_inst_id_, batch_id_, bytearray_id_
03 act_hi_actinst id_ 23
04 act_hi_dec_in id_ 24
05 act_hi_dec_out id_ 25
06 act_hi_decinst id_ 26
07 act_hi_detail id_ 27
08 act_hi_op_log id_ 28
09 act_hi_procinst id_ 29
10 act_hi_taskinst id_ 30
11 act_hi_varinst id_ 31
12 act_id_group id_ 32
13 act_id_user id_ 33
14 act_re_decision_def id_, dec_req_id_ 34
15 act_re_decision_req_def id_ 35
16 act_re_deployment id_ 36
17 act_re_procdef id_ 37
18 act_ru_authorization id_ 38
19 act_ru_execution id_, proc_inst_id_, parent_id_, proc_def_id_, super_exec_ 39

Knowledge

sudo snap install docker
sudo apt  install docker-compose
fedora: alter config
sudo alternatives --config java
sudo alternatives --config javac

debian: alter config
sudo update-alternatives --config java
sudo update-alternatives --config javac
rm -rf $HOME/.m2/repository/org/jetbrains/
rm -rf $HOME/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/
camunda: download bpmn
processEngine().getRepositoryService().createProcessDefinitionQuery().list();
processEngine().getRepositoryService().getProcessModel("someID");
sudo update-alternatives --remove-all camunda-modeler
docker login hub.chorke.org -u academia -p sadaqah!
docker pull camunda/camunda-bpm-platform:run-latest
docker run -d --name camunda -p 8080:8080 camunda/camunda-bpm-platform:run-latest
docker tag academia-bpmn:latest reg.chorke.org/academia-bpmn:latest
docker push reg.chorke.org/academia-bpmn:latest
docker rmi reg.chorke.org/academia-bpmn:latest

docker pull hub.chorke.org/academia-bpmn:latest
docker rmi hub.chorke.org/academia-bpmn:latest

References