aboutsummaryrefslogtreecommitdiffstats
path: root/docs/bpmn/Camunda_Cockpit_Community_Edition.rst
blob: a9379decc932f11795249d6c489f0152b15f1786 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2017 Huawei Technologies Co., Ltd.

Camunda Cockpit Community Edition
=================================

On a deployed instance of SO, you can use the Camunda_Cockpit to view BPMN 2.0 workflow definitions in the deployment.

.. _Camunda_Cockpit: https://camunda.org/features/cockpit/

Unfortunately, the Community Edition of Camunda included with SO is not fully featured.  It cannot be used to inspect running and completed process instances.  For that, the Enterprise Edition is required.

Logging In
-----------

Because port 8080 on the docker host machine is forwarded to port 8080 in the SO docker container you can log into the cockpit by browsing to this URL:

  http://*dockerhost*:8080/camunda/app/admin/default/#/login

  Where dockerhost is the docker host system.

If you can use a browser on the docker host system, then use a localhost address:

  http://localhost:8080/camunda/app/admin/default/#/login

The user is "admin" and the password is the same as the jboss admin password, which is not displayed here.

.. image:: images/Camunda_Cockpit_1.png

Viewing Process Definitions
---------------------------

Use the drop-down menu next to the home icon and select the "Cockpit" option:

.. image:: images/Camunda_Cockpit_2.png

The number of deployed process definitions should be displayed.  Click on it.

.. image:: images/Camunda_Cockpit_3.png

Now you should see an actual list of deployed process definitions.  You can click on any of them to view them.

.. image:: images/Camunda_Cockpit_4.png
highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
/*
 * ============LICENSE_START=======================================================
 * policy-endpoints
 * ================================================================================
 * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
 * Modifications Copyright (C) 2024 Nordix Foundation.
 * ================================================================================
 * 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.
 * ============LICENSE_END=========================================================
 */

package org.onap.policy.common.endpoints.event.comm.bus;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams.TopicParamsBuilder;

/**
 * Base class for Topic Test classes.
 */
public class TopicTestBase {

    public static final String MY_AFT_ENV = "my-aft-env";
    public static final String MY_API_KEY = "my-api-key";
    public static final String MY_API_SECRET = "my-api-secret";
    public static final String MY_BASE_PATH = "my-base";
    public static final String MY_CLIENT_NAME = "my-client";
    public static final String MY_CONS_GROUP = "my-cons-group";
    public static final String MY_CONS_INST = "my-cons-inst";
    public static final String MY_ENV = "my-env";
    public static final int MY_FETCH_LIMIT = 100;
    public static final int MY_FETCH_TIMEOUT = 101;
    public static final String MY_HOST = "my-host";
    public static final String MY_LAT = "my-lat";
    public static final String MY_LONG = "my-long";
    public static final String MY_PARTNER = "my-partner";
    public static final String MY_PASS = "my-pass";
    public static final int MY_PORT = 102;
    public static final String MY_TOPIC = "my-topic";
    public static final String MY_EFFECTIVE_TOPIC = "my-effective-topic";
    public static final String MY_USERNAME = "my-user";

    public static final String MY_MESSAGE = "my-message";
    public static final String MY_PARTITION = "my-partition";
    public static final String MY_MESSAGE2 = "my-message-2";
    public static final String MY_PARTITION2 = "my-partition-2";

    public static final String ROUTE_PROP = "routeOffer";
    public static final String MY_ROUTE = "my-route";
    public static final String MY_SERIALIZER = "org.apache.kafka.common.serialization.StringSerializer";
    public static final int KAFKA_PORT = 9092;

    /**
     * Message used within exceptions that are expected.
     */
    public static final String EXPECTED = "expected exception";

    /**
     * Additional properties to be added to the parameter builder.
     */
    protected Map<String, String> addProps;

    /**
     * Servers to be added to the parameter builder.
     */
    protected List<String> servers;

    /**
     * Servers to be added to the parameter builder.
     */
    protected List<String> kafkaServers;

    /**
     * Parameter builder used to build topic parameters.
     */
    protected TopicParamsBuilder builder;

    /**
     * Initializes {@link #addProps}, {@link #servers}, and {@link #builder}.
     */
    public void setUp() {
        addProps = new TreeMap<>();
        addProps.put("my-key-A", "my-value-A");
        addProps.put("my-key-B", "my-value-B");

        servers = Arrays.asList("svra", "svrb");
        kafkaServers = Arrays.asList("localhost:9092", "10.1.2.3:9092");

        builder = makeBuilder();
    }

    /**
     * Makes a fully populated parameter builder.
     *
     * @return a new parameter builder
     */
    public TopicParamsBuilder makeBuilder() {
        return makeBuilder(addProps, servers);
    }

    /**
     * Makes a fully populated parameter builder.
     * 
     * @param addProps additional properties to be added to the builder
     * @param servers servers to be added to the builder
     * @return a new parameter builder
     */
    public TopicParamsBuilder makeBuilder(Map<String, String> addProps, List<String> servers) {

        return BusTopicParams.builder().additionalProps(addProps).aftEnvironment(MY_AFT_ENV).allowSelfSignedCerts(true)
                        .apiKey(MY_API_KEY).apiSecret(MY_API_SECRET).basePath(MY_BASE_PATH).clientName(MY_CLIENT_NAME)
                        .consumerGroup(MY_CONS_GROUP).consumerInstance(MY_CONS_INST).environment(MY_ENV)
                        .fetchLimit(MY_FETCH_LIMIT).fetchTimeout(MY_FETCH_TIMEOUT).hostname(MY_HOST).latitude(MY_LAT)
                        .longitude(MY_LONG).managed(true).partitionId(MY_PARTITION).partner(MY_PARTNER)
                        .password(MY_PASS).port(MY_PORT).servers(servers).topic(MY_TOPIC)
                        .effectiveTopic(MY_EFFECTIVE_TOPIC).useHttps(true).allowTracing(true).userName(MY_USERNAME)
                        .serializationProvider(MY_SERIALIZER);
    }

    /**
     * Makes a fully populated parameter builder.
     *
     * @return a new parameter builder
     */
    public TopicParamsBuilder makeKafkaBuilder() {
        addProps.clear();
        String jaas = "org.apache.kafka.common.security.plain.PlainLoginModule "
            + "required username=abc password=abc serviceName=kafka;";
        addProps.put("sasl.jaas.config", jaas);
        addProps.put("sasl.mechanism", "SCRAM-SHA-512");
        addProps.put("security.protocol", "SASL_PLAINTEXT");

        return makeKafkaBuilder(addProps, kafkaServers);
    }

    /**
     * Makes a fully populated parameter builder.
     *
     * @param addProps additional properties to be added to the builder
     * @param servers servers to be added to the builder
     * @return a new parameter builder
     */
    public TopicParamsBuilder makeKafkaBuilder(Map<String, String> addProps, List<String> servers) {

        return BusTopicParams.builder().additionalProps(addProps).basePath(MY_BASE_PATH).clientName(MY_CLIENT_NAME)
                        .consumerGroup(MY_CONS_GROUP).consumerInstance(MY_CONS_INST).environment(MY_ENV)
                        .hostname(MY_HOST).partitionId(MY_PARTITION).partner(MY_PARTNER).fetchTimeout(MY_FETCH_TIMEOUT)
                        .port(KAFKA_PORT).servers(servers).topic(MY_TOPIC)
                        .effectiveTopic(MY_EFFECTIVE_TOPIC).useHttps(false).allowTracing(true);
    }
}