Currently when you generate your jBPM Business Application (online via start.jbpm.org, command-line via the jba-cli package, or in Visual Studio code via the jBPM extension) your app will have CORS (Cross-origin resource sharing) disabled by default.
With CORS disabled, if you have a consumer app (e.g. React frontend) which does not live on the same domain as your business app, it will not be able to query its REST api.
CORS will be enabled by default with the next jBPM community release (7.18.0.Final), see Jira JBPM-8176, but if you would like to enable this on you own now, it is very easy to do:
In your generated business app service module edit the DefaultWebSecurityConfig.java file and replace it with the one in this Gist. That’s it 🙂
With this change in place you will now be able to query your business apps REST api from any domain, for example if you are using jQuery.ajax and want to get your server information (/rest/server endpoint) you could do for example:
If you are developing your apps using Visual Studio Code you can now install a new jBPM Business Application extension. With this extension and the great tooling support of VSC you can now generate, develop, and launch your jBPM business apps without ever leaving your development environment.
Here is the youtube video showcasing how to install and use this extension:
The sources of the extension are on github. We are looking for contributions to make this extension better in the future.
Service tasks (aka work items) are of tremendous use in business processes. Users can build their custom logic into well defined tasks that can be reused across processes or even projects. jBPM comes with rather large set of service tasks out of the box, you can explore them in jbpm-work-items repository in GitHub.
jBPM also provides standalone service repo that could be used from jBPM designer to import service tasks. Though that was just intermediate step towards better integration with authoring tooling – Business Central.
Brand new integration between service task repository and business central is under development and I’d like to share a bit of news about this upcoming feature…
Service Task administration
First and foremost there is global administration of service tasks. This allows to select what service tasks (that the authoring environment comes with) are allowed to be installed in projects.
There are three configuration options
Install as Maven artefact – will upload the jar file of the handler if it does not exist in the local or Business Central’s maven repo
Install service tasks artefact as maven dependency of project – will update pom.xml of project upon installation of the service task
Use version range – when adding service task artefact as project dependency it will use version range instead of fixed version e.g. [7.16,) instead of 7.16.0.Final
Service task installation – project settings
Once the service tasks are enabled they can be used within projects. Simply go into project settings page and install (or uninstall) service tasks of your desire. Note that this settings page will only list service tasks that are globally enabled.
Service tasks can then be installed into projects. During installation following will be done
dedicated wid (work definition) file is created for installed service task
custom icon for the service task is installed into project resources (if exists)
pom.xml of the project is updated to include dependencies (if it is enabled in the global settings)
deployment descriptor is updated to register work item handler for the service task
Similar steps are performed for uninstallation though to remove rather than add configuration.
Here is a short video (this time with audio.. not sure if that is good or bad …) that illustrates the entire feature working together, including use of service task in business process.
This is part one of this feature so stay tuned for more updates in coming weeks…
Here is a complete video showing all features in action including
service repository administration
uploading new service tasks
default service tasks (REST, Email, Decision, etc)
installing service tasks into project with prompt for required parameters
This feature is planned for 7.17 so all the feedback is more than welcome.
In this demo we show how you can easily integrate React into your existing or new jBPM Business Application and consume data from the the out-of-the-box Rest services via React components.
As usual all the sources of this demo are on GitHub. The demo integrates the React front-end app with the service module of your jBPM Business application via the frontend-maven-plugin and then bundles its resources in the generated business app jar. This way you can just start your business app with the provided launch scripts and both React frontend and your business app backend will be available and started together.
When building the demo the same plugin will also attempt to install node and npm (which are needed for React apps) if they are not available on your machine. It will also build the React frontend for you, so no need to build it separately.
Here is the youtube video for this demo:
Feel free to leave us any comments about this demo and ideas on how to improve it or what you would like to see next.
By default jBPM Business Applications generated via start.jbpm.org are build with Apache Maven. Your generated apps also include build scripts (for Unix, OSX, and Windows) which you can use out of the box to build all the apps modules, as well as launch your app in normal or dev modes.
Using Maven is fine however it excludes Gradle users from being able to build and launch jBPM Business Applications using their favorite build tool.
If you are using Gradle, take a look at this GitHub repo which includes Gradle build files as well as build scripts that call Gradle to build and launch your business application.
Follow the documentation there to set up your Gradle build environment for your generated jBPM business app.
Note that the out-of-the-box Maven build scripts are still the preferred choice when building your app. This is because the limitation of the Gradle scripts not being able to deploy your app on Docker and Openshift. We use the fabric8 plugin to help us do that and this plugin is not currently available for Gradle unfortunately (you can get more info on that here).
Also to note we are not Gradle experts and it would be really helpful if our jBPM community could help us with making the Gradle build for jBPM Business Applications better. If you are interested please clone https://github.com/tsurdilo/jbpm-business-apps-gradle and submit changes via git pull requests and share it to our community. We would really appreciate that!!
The demo uses the developer.okta.com setup and the Okta Spring boot starter to quickly set up SSO for our jBPM Business App. It also shows how easy it is to restrict access to certain pages of your jBPM Business Application using the authentication info and identity setup in Okta.
The demo requires you to make an account on developer.okta.com (its free) and create an Okta application and set up two group called “Admin” and “Sales”
Okta group setup
Only other configuration is in the your apps application.properties file:
All of this information you get for free once you create an account and an application on the Okta developer site.
Once you have completed this setup and start the Okta demo app, go to localhost:8090 and to authenticate and access your app. Note that since there is no logout feature in the demo app, in order to simulate the logout simply delete your recent browser cookies.
If you don’t create and set up the “Sales” group in Okta for your application there accessing localhost:8090/sales will give you a “403” page:
Demo app 403 page
Otherwise you will be able to access it:
Demo sales page
The apps index page is authorized to users that are in the “Admin” group that you have set up in Okta.
Here is a youtube video which walks you through the Okta demo and shows how simple it is to set
jBPM Business Applications have an out-of-the-box configurations to deploy them as docker containers. We have created the video below to show you how easy it is to do that. The video also shows some useful docker commands to run after you have deployed your jBPM Business app as docker container. Enjoy.
So far our jBPM Business Applications demos have involved some sort of web-based UI for interacting with our business processes. Sometimes a web-ui is not needed and working with processes via an interactive terminal is the best way to get this done.
In this demo we show how to use Spring Shell inside your jBPM Business Application created via start.jbpm.org. Here is a quick screenshot of the demo application:
We start our demo app as usual using the already provided launch scripts but once it starts we do not launch our browser and go to localhost:8090 (default) to access it, but instead we are presented with a prompt and can start typing in our commands to interact with our business processes.
Spring Shell provides some very useful commands out of the box, such as “help”, “clear”, “exit”, “history”, and “stacktrace”. Our demo app defined ontop of that our own custom commands to interact with our business processes.
Commands that we define in our business app demo are:
deploy <groupId> <artifactId> <version>
startprocess <processDefId> <deploymentId>
Our deploy command allows us to deploy a kjar module which is available in our local maven repository. The demo app comes with one such module which you can use to deploy after the application has started with the command:
The processdefs command simply shows all currently available process definition (across all deployments):
The startprocess command allows you to start a business process. It takes in the process definition id and the deployment unit id (if deployment unit id is not specified, the default one is assumed). So for example to start our “firstTestProcess” business process we can do:
Lastly, the processinstances command shows all process instances that are available, for example:
Finally here is a youtube video where we run the demo and show off all the commands. The video also explains the code and how to create custom commands using Spring Boot and Spring Shell.
(This is the first time I tried creating a youtube video intro so please don’t laugh ….too much 🙂 )
Hope this demo helps you guys get some ideas on how to create cool jBPM business apps.