Pular para o conteúdo principal

Postagens

Mostrando postagens com o rótulo cdi

Using jBPM embedded and CDI in a JavaFX application

A few years ago I wrote about using jBPM remote API from JavaFX . That was straightforward because the remote APIs are usually simply wrappers to REST APIs running on server side. Since then a few things happened: jBPM is in version 7.7, that article was for jBPM 6.3.0! In version 7 the Business Central execution server was replaced by Kie Server (we even wrote a JavaFX client for Kie Server ) A new jBPM services API was introduced and it is mature and ready for production use. CDI 2.0 was released and it allows the use of CDI in standalone Java applications ( and in a JavaFX application as we described ). We could use jbpm embedded at that time, but we would have to make use of underlying Kie APIs (RuntimeManager, KieSession, etc), which I was not willing to use at that time. With services API we can easily bring jbpm to every Java application, just just one of its flavors: CDI, EJB, Spring or pure Java. But what is different from using embedded jbpm from Kie Server?...

JavaFX with Bean Validation and CDI 2.0

When JavaFX 2 was released I remember people looking for frameworks that would make easy to integrate JavaFX with a validation framework, a dependency injection container and other enterprise services. Currently we can integrate CDI 2.0 and Bean Validation 2.0 with a JavaFX application without the need of any external framework. In this post I will show you how to validate your javaFX screen fields using bean validation in a CDI managed application. Before talking about all these things and JavaFX I recommend you to check the following posts from this blog: Using CDI 2.0 in a JavaFX application Testing Bean Validation 2.0 Validating JavaFX controls using Bean Validation With Bean Validation 2.0 we have the automatic unwrap of JavaFX properties. Which means that if you have a field that is of type of ObservableValue so the validator implementation will be able to retrieve the actual value to perform the validation. However, JavaFX control fields are still not supported, so...

Using CDI 2.0 in a JavaFX application

With the CDI 2.0 release we have a container that can be used in Java SE applications! Previously if you wanted to make use of CDI 1.x in a Java SE application you had to use Weld classes, see  FXML & JavaFX—Fueled by CDI & JBoss Weld post. Adam Bien introduced the SE container in a video, see: Of course I had to try it with JavaFX so I can use CDI in some personal applications! Create the Container in a JavaFX Application By JavaFX application I mean the class that extends javafx.application.Application, which is the entry point for JavaFX apps and where the main stage can be used. To use CDI we should create the SeContainer and make sure that it create all classes managed by CDI. This should be done in the entry point Application class so we manage all the classes created from there. Once you started the container you have different ways to send the initial stage to the actual Application class, for example, you can have users to implement an interf...