https://github.com/kiegroup/jbpm-form-modeler/tree/6.2.x/jbpm-form-modeler-sample-custom-types/jbpm-form-modeler-custom-file-type
Saturday, May 8, 2021
Implement your own form renderer for KIE Server
- based on PatterFly to provide same look and feel as entire jBPM tooling - it's the default renderer
- based on Bootstrap to provide a simple alternative that utilises well established framework for building web and mobile UIs
Create project with dependencies
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.kie.server.samples</groupId>
<artifactId>custom-form-renderer</artifactId>
<version>1.0.0</version>
<name>Custom Form Renderer</name>
<properties>
<version.org.kie>7.14.0.Final</version.org.kie>
</properties>
<dependencies>
<dependency>
<groupId>org.kie.server</groupId>
<artifactId>kie-server-services-jbpm-ui</artifactId>
<version>${version.org.kie}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Create configuration folders
Create folders in the project that will configure the renderer - all should be done src/main/resources- form-templates-providers - folder that will contain templates, css and java script files used to render the form
- META-INF/services/org.kie.server.services.jbpm.ui.form.render.FormRenderer - an empty file that will be used as discovery mechanism to find and register the renderer - it will be edited a bit later to provide actual implementation details
Create form renderer implementation
- getName - provide the name of the template that shall be used as reference when rendering
- loadTemplates - main implementation that loads different types of templates to be used by renderer
- default constructor
- master - main template that builds the HTML page
- header - header template that creates header of the form
- form-group - form input fields template
- case-layout - layout for case forms
- process-layout - layout for process forms
- task-layout - layout for user task forms
- table - table to be build for multi subforms
package org.kie.server.samples;
import org.kie.server.services.jbpm.ui.form.render.AbstractFormRenderer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CustomFormRenderer extends AbstractFormRenderer {
private static final Logger logger = LoggerFactory.getLogger(CustomFormRenderer.class);
public CustomFormRenderer() {
super(null, null);
}
public CustomFormRenderer(String serverPath, String resources) {
super(serverPath, resources);
}
public String getName() {
return "custom";
}
@Override
protected void loadTemplates() {
loadTemplate(MASTER_LAYOUT_TEMPLATE, this.getClass().getResourceAsStream("/form-templates-providers/custom/master-template.html")); loadTemplate(PROCESS_LAYOUT_TEMPLATE, this.getClass().
getResourceAsStream("/form-templates-providers/custom/process-layout-template.html")); loadTemplate(TASK_LAYOUT_TEMPLATE, this.getClass().
getResourceAsStream("/form-templates-providers/custom/task-layout-template.html")); loadTemplate(FORM_GROUP_LAYOUT_TEMPLATE, this.getClass().
getResourceAsStream("/form-templates-providers/custom/input-form-group-template.html")); loadTemplate(HEADER_LAYOUT_TEMPLATE, this.getClass().
getResourceAsStream("/form-templates-providers/custom/header-template.html")); loadTemplate(CASE_LAYOUT_TEMPLATE, this.getClass().
getResourceAsStream("/form-templates-providers/custom/case-layout-template.html")); loadTemplate(TABLE_LAYOUT_TEMPLATE, this.getClass().
getResourceAsStream("/form-templates-providers/custom/table-template.html")); logger.info("Custom Form renderer templates loaded successfully."); } }
Customise your templates
Build and deploy renderer to KIE Server
- Build the project with maven - mvn clean package
- Deploy the project to KIE Server by coping the jar file to kie-server.war/WEB-INF/lib
That's it, you have now your custom form renderer. The sample described in this article can be found in GitHub.
Let's embed forms ... rendered by KIE Server
jBPM comes with rather sophisticated form modeller that allows to
graphically build forms for processes and tasks. These forms can then be
used to interact with process engine to start new instances or complete
user tasks.
One of the biggest advantages of using forms built in workbench is that
they share the same life cycle as your business assets (processes and
user tasks). By that they are versioned exactly the same way - so if you
have another version of a process that requires more information to
start you simply create new version of the project and make changes to
both process definition and form. Once deployed you can start different
versions of the process using dedicated forms.
Although to be able to take advantage of these forms users have to be
logged into workbench as the only way to render the content is ...
through workbench itself. These days are now over ... KIE Server
provides pluggable renderers for forms created in workbench. That means
you can solely interact with kie server to perform all the needed
operations. So what does this brings:
- renders process forms - used to start new instances
- renders case forms - used to start new case instances - includes both data and role assignments
- renders user task forms - used to interact with user tasks - includes life cycle operations
Worth noting is that rendered forms are fully operational, meaning they come with buttons to perform all the operations that are based on the context - e.g. if user task is in in progress state there are buttons to stop, release, save and complete.
![]() |
| Evaluation start process form |
![]() |
| Mortgage start process form |
![]() |
| IT Orders start case form |
- based on PatternFly - this is the default renderer that keeps the look and feel consistent with workbench
- based on Bootstrap
http://localhost:8080/kie-server/services/rest/server/containers/evaluation/forms/processes/evaluation/content http://localhost:8080/kie-server/services/rest/server/containers/evaluation/forms/tasks/1/content http://localhost:8080/kie-server/services/rest/server/containers/mortgage-process/forms/processes/Mortgage_Process.MortgageApprovalProcess/content http://localhost:8080/kie-server/services/rest/server/containers/mortgage-process/forms/tasks/2/content http://localhost:8080/kie-server/services/rest/server/containers/itorders/forms/cases/itorders.orderhardware/content http://localhost:8080/kie-server/services/rest/server/containers/itorders/forms/tasks/3/content
Note that containers are given as alias so that brings in additional
benefits when working with forms and multiple project versions.
And at the end few short screen casts showing this feature in action
Ref: https://mswiderski.blogspot.com/2018/10/lets-embed-forms-rendered-by-kie-server.html
Friday, May 7, 2021
How to change variable value via task script in redhat PAM
Use kcontext to update variable value
kcontext.setVariable("validationError",validationError1);
Wednesday, April 28, 2021
Enable SSL Trace in IBM HTTP server
Step 1: Stop IBM HTTP Server.
Step 2: Turn on IBM HTTP Server verbose logging for SSL
Append the LogLevel directive to httpd.conf:
- IBM HTTP Server 9.0 and later:
LogLevel debug ibm_ssl:trace8
- IBM HTTP Server 8.5.5 and earlier:
LogLevel debug
Append SSLTrace directive to httpd.conf (no argument)
SSLTrace
Step 3: Start HTTP Server.
List all supported ciphers if ibm http server.
Use the below command to list all support ciphers
Tuesday, April 27, 2021
Use separate cer for separate domain with nginx ingress in kubernetes
We have nginx ingress to control https service and forward to backend in kubernetes. We want some thing like domain abc.com should use "abc.com" 's certificate and domain xyz.com should use "xyz.com" 's certificate.
Step 1: Create TLS Secrets
Anytime we reference a TLS secret, we mean a PEM-encoded X.509, RSA (2048) secret.
You can generate a self-signed certificate and private key with:
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout abc.key -out abc.cer -subj "/CN=abc.com/O=abc.com"
Then create the secret in the cluster via:
$kubectl create secret tls abc --key abc.key --cert abc.cer
The resulting secret will be of type kubernetes.io/tls.
We add same tls for xyz.com domain.
Step 2: Add ingress resource
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
# Enable client certificate authentication
nginx.ingress.kubernetes.io/auth-tls-verify-client: "on"
# Create the secret containing the trusted ca certificates
nginx.ingress.kubernetes.io/auth-tls-secret: "default/ca-secret"
# Specify the verification depth in the client certificates chain
nginx.ingress.kubernetes.io/auth-tls-verify-depth: "1"
# Specify an error page to be redirected to verification errors
nginx.ingress.kubernetes.io/auth-tls-error-page: "http://www.mysite.com/error-cert.html"
# Specify if certificates are passed to upstream server
nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream: "true"
name: nginx-test
namespace: default
spec:
rules:
- host: abc.com
http:
paths:
- backend:
serviceName: http-svc
servicePort: 80
path: /
tls:
- hosts:
- abc.com
secretName: abcRef: https://kubernetes.github.io/ingress-nginx/examples/auth/client-certs/
Install and use xorg-server on macOS via Homebrew
The instructions to install and use xorg-server on macOS via Homebrew: Install Homebrew (if you haven't already): /bin/bash -c ...
-
Ref: https://blogs.sap.com/2016/11/25/get-to-know-camels-simple-expression-language-in-hci/ Introduction Simple is a, well, simple express...
-
WebRequest The function sends an HTTP request to a specified server. The function has two versions: 1. Sending simple requests of typ...
-
The instructions to install and use xorg-server on macOS via Homebrew: Install Homebrew (if you haven't already): /bin/bash -c ...



