SlideShare uma empresa Scribd logo
1 de 71
Friday, April 19, 13
Drools
                            in a nutshell
                       Everything you always wanted to know
                              but didn't know whom to ask! ;)


Friday, April 19, 13
porcelli@redhat.com
                  no:sql(br)                                                                         @porcelli

rcelli



              Alexandre Porcelli
              Program Committee

                                   Alexandre Porcelli
                                   Program Committee
                                   Emerging Languages on the JVM

                                                                   Alexandre Porcelli
                                                                   Core Engineer


  #guvnordev                                                                            Alexandre Porcelli
  #droolsdev                                                                            Principal Software Engineer

  #jbpmdev
  #optaplanner-dev

 Friday, April 19, 13
Drools?                              was born as a rule engine ...
                                             evolved as business modeling solution ...
                       targets as knowledge representation and reasoning platform!




Friday, April 19, 13
opta
                 expert   fusion             guvnor
                                   planner



                              jbpm      jbpm
                       jbpm
                              console   designer



Friday, April 19, 13
expert   guvnor




Friday, April 19, 13
so...
            what?
Friday, April 19, 13
Logic and Data Separation

                 Speed and Scalability
                                 Understandable Rules

                       Centralization of Knowledge

             Declarative Programming

Friday, April 19, 13
rule
                       what is



Friday, April 19, 13
rule <rule_name>
                           <attribute><value>
                           when
                               <conditions>
                           then
                               <actions>
                       end



Friday, April 19, 13
rule "Infer Adult"
       when
           $p : Person( age >= 18 )
       then
           System.out.println("Adult!");
   end




Friday, April 19, 13
patternmatching

                       Person( age >= 18 )
                                        field name          restriction


                        object type                 constraint



                                        pattern




Friday, April 19, 13
rule "Infer Child"            rule "Infer Baby"
                   when                          when
                       Person( age < 18 )            Person( age <= 2 )
                   then                          then
                       //code                        //code
               end                           end


            rule "Infer Adult"              rule "Infer Senior"
                when                            when
                    Person( age >= 18 )             Person( age >= < 60 )
                then                            then
                    //code                          //code
            end                             end



Friday, April 19, 13
Person(age=10)
               rule "Infer Child"            rule "Infer Baby"
                   when                          when
                       Person( age < 18 )            Person( age <= 2 )
                   then                          then
                       //code                        //code
               end                           end


            rule "Infer Adult"              rule "Infer Senior"
                when                            when
                    Person( age >= 18 )             Person( age >= < 60 )
                then                            then
                    //code                          //code
            end                             end



Friday, April 19, 13
Person(age=22)
               rule "Infer Child"            rule "Infer Baby"
                   when                          when
                       Person( age < 18 )            Person( age <= 2 )
                   then                          then
                       //code                        //code
               end                           end


            rule "Infer Adult"              rule "Infer Senior"
                when                            when
                    Person( age >= 18 )             Person( age >= < 60 )
                then                            then
                    //code                          //code
            end                             end



Friday, April 19, 13
Person(age=61)
               rule "Infer Child"            rule "Infer Baby"
                   when                          when
                       Person( age < 18 )            Person( age <= 2 )
                   then                          then
                       //code                        //code
               end                           end


            rule "Infer Adult"              rule "Infer Senior"
                when                            when
                    Person( age >= 18 )             Person( age >= < 60 )
                then                            then
                    //code                          //code
            end                             end



Friday, April 19, 13
Person(age=1)
               rule "Infer Child"            rule "Infer Baby"
                   when                          when
                       Person( age < 18 )            Person( age <= 2 )
                   then                          then
                       //code                        //code
               end                           end


            rule "Infer Adult"              rule "Infer Senior"
                when                            when
                    Person( age >= 18 )             Person( age >= < 60 )
                then                            then
                    //code                          //code
            end                             end



Friday, April 19, 13
OtherObject()
               rule "Infer Child"            rule "Infer Baby"
                   when                          when
                       Person( age < 18 )            Person( age <= 2 )
                   then                          then
                       //code                        //code
               end                           end


            rule "Infer Adult"              rule "Infer Senior"
                when                            when
                    Person( age >= 18 )             Person( age >= < 60 )
                then                            then
                    //code                          //code
            end                             end



Friday, April 19, 13
decouple logic
       rule "Infer Child"                            rule "Infer Adult"
           when                                          when
               $p : Person( age < 18 )                       $p : Person( age >= 18 )
           then                                          then
                insertLogical( new IsChild( $p ) )            insertLogical( new IsAdult( $p ) )
       end                                           end




   rule "Issue Child Bus Pass"                       rule "Issue Adult Bus Pass"
       when                                              when
            $p : Person( )                                    $p : Person( )
                 IsChild( person == $p )                           IsAdult( person =$p )
   then                                              then
        insertLogical( new ChildBusPass( $p ) );          insertLogical( new AdultBusPass( $p ) );
   end                                               end




Friday, April 19, 13
patternmatching
                       Person( $age : age )

                       Person( age == ( $age + 1 ) )

                       Person( age > 30 && < 40 || hair in ("black", "brown") )

                       Person( pets contains $rover )

                       Person( pets["rover"].type == "dog" )

                       Person( insurance.valid )




Friday, April 19, 13
under the
       hood
Friday, April 19, 13
hybrid
                       reasoning
                       system

Friday, April 19, 13
WTF?
Friday, April 19, 13
forward
    backward
    chainning
Friday, April 19, 13
WTF?
Friday, April 19, 13
forwardchainning
                             data driven/reactionary
                 rule "Adults that like cheddar"
                     when
                          Cheese( $cheddar : name == "cheddar" )
                     $p : Person( age >= 18, favouriteCheese == $cheddar )
                     then
                         System.out.println( $p.getName() + " likes cheddar!");
                 end




Friday, April 19, 13
backwardchainning
                                                                  goal driven
                                                                  declare Parent
                       declare Man          declare Woman
                                                                      parent : String
                           name : String        name : String
                                                                      child : String
                       end                  end
                                                                  end


                          query man( String name )
                              Man( name := name )
                          end

                          query woman( String name )
                              Woman( name := name )
                          end

                          query parent( String parent, String child )
                              Parent( parent := parent, child := child )
                          end




Friday, April 19, 13
backwardchainning
                       query father( String father, String child )
                           ?man( father; )
                           ?parent( father, child; )
                       end

                       query mother( String mother, String child )
                           ?woman( mother; )
                           ?parent( mother, child; )
                       end

                       query son( String son, String parent )
                           ?man( son; )
                           ?parent( parent, son; )
                       end

                       query daughter( String daughter, String parent )
                           ?woman( daughter; )
                           ?parent( parent, daughter; )
                       end




Friday, April 19, 13
backwardforward
                       fewer hypotheses lot’s hypotheses
                             query data lot’s data upfront




Friday, April 19, 13
rete
        algorithm
Friday, April 19, 13
reteoo
         rule "Like cheddar"
         when
             Cheese( $cheddar : name == "cheddar" )
              $p : Person( favouriteCheese == $cheddar )
         then
             System.out.println( $p.getName() + " likes cheddar" );
         end


         rule "NOT Like cheddar"
         when
             Cheese( $cheddar : name == "cheddar" )
              $p : Person( favouriteCheese != $cheddar )
         then
             System.out.println( $p.getName() + " not like cheddar" );
         end



Friday, April 19, 13
reteoo
                         rete node

                          object type node

                         alpha node

                         left input node

                         join node

                         terminal




Friday, April 19, 13
reteoo
                         rete node

                          object type node

                         alpha node

                         left input node

                         join node

                         terminal




Friday, April 19, 13
reteoo
                         rete node

                          object type node

                         alpha node

                         left input node

                         join node

                         terminal




Friday, April 19, 13
reteoo
                         rete node

                          object type node

                         alpha node

                         left input node

                         join node

                         terminal




Friday, April 19, 13
so...
            how?
Friday, April 19, 13
Friday, April 19, 13
codeapi
               final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
               // this will parse and compile in one step
               kbuilder.add( ResourceFactory.newClassPathResource("HelloWorld.drl",
                             HelloWorldExample.class), ResourceType.DRL);

               // Check the builder for errors
               if ( kbuilder.hasErrors() ) {
                   throw new RuntimeException("Error compiling.");
               }

               // get the compiled packages (which are serializable)
               final Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages();

               // add the packages to a KnowledgeBase (deploy the knowledge packages).
               final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
               kbase.addKnowledgePackages(pkgs);




Friday, April 19, 13
codeapi
             final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
             ksession.setGlobal( "myGlobalObj", globalObj );

             for( Object fact : _facts_ ) {
                 ksession.insert( fact );
             }




                                              ksession.fireUntilHalt();

            ksession.fireAllRules();          SessionEntryPoint entryPoint =
                                                   ksession.getEntryPoint( "entrypoint_name" );
            ksession.dispose();
                                              entryPoint.insert( _fact_ );




Friday, April 19, 13
codeapi
              final StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();

               ksession.execute( _facts_ );




Friday, April 19, 13
please
            one sec!
Friday, April 19, 13
Friday, April 19, 13
new
            paradigm?
Friday, April 19, 13
yesno
Friday, April 19, 13
yes   you can construct
                             your systems using
                             almost only rules!




Friday, April 19, 13
pong
                         demo
Friday, April 19, 13
no
  you can adapt your
      existing systems
    (few lines) to take
  advantage of drools




Friday, April 19, 13
public void aprovarPagamento(String apoliceId, String sinistroId,
                       "    "    int valor, String cpfAprovador) {

                       "   if (!existeReserva(sinistroId)) {
                       "   "    throw new IllegalStateException(
                       "   "    "    "    "não existe reserva para o sinistro.");
                       "   }

                       "   Pessoa aprovador = pessoaService.buscarPessoa(cpfAprovador);
                       "   if (aprovador.getPapeis()
                       "   "    "    .contains(Pessoa.Papeis.COORDENADOR_SEGURADORA)
                       "   "    "    || aprovador.getPapeis().contains(
                       "   "    "    "    "    Pessoa.Papeis.GERENTE_SEGURADORA)
                       "   "    "    || aprovador.getPapeis().contains(
                       "   "    "    "    "    Pessoa.Papeis.DIRETOR_SEGURADORA)
                       "   "    "    || aprovador.getPapeis().contains(Pessoa.Papeis.VP_SEGURADORA)) {
                       "   "    if (valor <= 5000) {
                       "   "    "    pagar(apoliceId, sinistroId, valor);
                       "   "    } else if (valor > 500000) {
                       "   "    "    if (aprovador.getPapeis().contains(Pessoa.Papeis.VP_SEGURADORA)) {
                       "   "    "    "    pagar(apoliceId, sinistroId, valor);
                       "   "    "    } else {
                       "   "    "    "    throw new IllegalStateException(
                       "   "    "    "    "    "    "Aprovador não tem alçada para aprovação.");
                       "   "    "    }
                       "   "    } else if (valor <= 10000) {
                       "   "    "    if (aprovador.getPapeis().contains(
                       "   "    "    "    "    Pessoa.Papeis.GERENTE_SEGURADORA)
                       "   "    "    "    "    || aprovador.getPapeis().contains(
                       "   "    "    "    "    "    "    Pessoa.Papeis.DIRETOR_SEGURADORA)
                       "   "    "    "    "    || aprovador.getPapeis().contains(
                       "   "    "    "    "    "    "    Pessoa.Papeis.VP_SEGURADORA)) {
                       "   "    "    "    pagar(apoliceId, sinistroId, valor);
                       "   "    "    } else {
                       "   "    "    "    throw new IllegalStateException(
                       "   "    "    "    "    "    "Aprovador não tem alçada para aprovação.");
                       "   "    "    }
                       "   "    } else if (valor <= 500000) {
                       "   "    "    if (aprovador.getPapeis().contains(
                       "   "    "    "    "    Pessoa.Papeis.DIRETOR_SEGURADORA)
                       "   "    "    "    "    || aprovador.getPapeis().contains(
                       "   "    "    "    "    "    "    Pessoa.Papeis.VP_SEGURADORA)) {
                       "   "    "    "    pagar(apoliceId, sinistroId, valor);
                       "   "    "    } else {
                       "   "    "    "    throw new IllegalStateException(
                       "   "    "    "    "    "    "Aprovador não tem alçada para aprovação.");
                       "   "    "    }
                       "   "    } else {
                       "   "    "    throw new IllegalStateException("Problemas na aprovação.");
                       "   "    }
                       "   } else {
                       "   "    throw new IllegalStateException(
                       "   "    "    "    "Aprovador não é funcionário da seguradora.");
                       "   }
                       }




Friday, April 19, 13
system

                             control flow                    control flow                    control flow
                                business rules                  business rules                  business rules

                       control flow                     control flow                    control flow
                        business rules                   business rules                  business rules
                          business rules                  business rules                  business rules


                        control flow                    control flow                    control flow
                                       business rules                  business rules                  business rules




Friday, April 19, 13
public void aprovarPagamento( String apoliceId,
                                                     String sinistroId,
                                                     int valor,
                                                     String cpfAprovador ) {
                           if ( !existeReserva( sinistroId ) ) {
                               throw new IllegalStateException(
                                       "Não existe reserva para o sinistro." );
                           }

                           final Pessoa aprovador = pessoaService.buscarPessoa( cpfAprovador );

                           final ValorPagamentoApolice pagamento = new ValorPagamentoApolice( ... );

                           ksession.execute( asList( aprovador, pagamento ) );
                           if ( !pagamento.isPago() ) {
                               throw new IllegalArgumentException( "Pagamento nao efetuado." );
                           }
                       }




Friday, April 19, 13
rule "Coordenador tentando fraudar"
                                                  " when
                                                  " " p: Pessoa ( papeis contains Pessoa.Papeis.COORDENADOR_SEGURADORA )
                                                  " " v: ValorPagamentoApolice( valor > 50000 )
                                                  " " f: FinanceiroService( )
                                                  " then
                                                  "      System.out.println("O coordenador tentou fazer um pagamento não autorizado");
                                                  " " retract( f );
                                                  end
       rule "VP"
       " when
       " " m : Pessoa( papeis contains Pessoa.Papeis.VP_SEGURADORA )
       " " v: ValorPagamentoApolice( valor > 500000 )
       " " f: FinanceiroService( )
       " then
       "      executar(f, v);
       " " retract( f );
       end

                                        rule "Nenhum funcionario pode aprovar sua apolice"
                                        salience 8888
                                        " when
                                        " " p : Pessoa( $cpfPessoa: cpf )
                                        " " v: ValorPagamentoApolice( cpfSefurado == $cpfPessoa, valor >= 50000 )
                                        " " f: FinanceiroService( )
                                        " then
                                        "      System.out.println("O profissional tentou aprovar sua apolice.");
                                        "      retract( f );
             rule "Diretor ou VP"       end
             " when
             " " m : Pessoa( papeis contains Pessoa.Papeis.DIRETOR_SEGURADORA ||
             " " " " " papeis contains Pessoa.Papeis.VP_SEGURADORA )
             " " v: ValorPagamentoApolice( valor > 10000 && <= 500000 )
             " " f: FinanceiroService( )
             " then
             "      executar(f, v);
             " " retract( f );
             end




Friday, April 19, 13
system

                          control flow            control flow             control flow
                             business rules          business rules                                             business rules
                control flow                  control flow            control flow                    business rules
                                                                                                      business rules
                                                                                                             business rules
                       business rules                                   business rules
                                                                                                        business rules
                 control flow                 control flow            control flow
                                                                                     business rules
                                                                                                                         guvnor




Friday, April 19, 13
F.A.Q.

Friday, April 19, 13
business analyst
     write rules?
Friday, April 19, 13
yesno
Friday, April 19, 13
no
                   they won’t do this:
    rule "NOT Like cheddar"
    when
        Cheese( $cheddar : name == "cheddar" )
         $p : Person( favouriteCheese != $cheddar )
    then
        System.out.println( $p.getName() + " not like cheddar" );
    end


                                                  technical rule




Friday, April 19, 13
yes
                             but they can do this:



                                         decision table




Friday, April 19, 13
yes
                             and this




                                        test scenario




Friday, April 19, 13
so...
            next?
Friday, April 19, 13
droolsv6
Friday, April 19, 13
retewilldie
                        http://blog.athico.com/2013/01/life-beyond-rete-rip-rete-2013.html




phreak
Friday, April 19, 13
maven
                                           compatible
                       project structure




kjar
Friday, April 19, 13
KieServices ks = KieServices.Factory.get();
                       KieContainer kContainer = ks.getKieClasspathContainer();
                       KieSession kSession = kContainer.newKieSession("ksession2");
                       kSession.setGlobal("out", out);

                       kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?"));
                       kSession.fireAllRules();




newapi
Friday, April 19, 13
                                                                                         java code
public class KProject {

                           @Inject @KBase("fol4.test1.KBase1")
                           KnowledgeBase kBase1;

                           public KnowledgeBase getKBase1() {
                               return kBase1;
                           }

                           @Inject @KBase("fol4.test2.KBase2")
                           KnowledgeBase kBase2;

                           public KnowledgeBase getKBase2() {
                               return kBase2;
                           }

                           @Inject @KSession("fol4.test1.KSession1")
                           StatelessKnowledgeSession kBase1kSession1;




cdi
                           public StatelessKnowledgeSession getKBase1KSession1() {
                               return kBase1kSession1;
                           }

                           @Inject @KSession("fol4.test1.KSession2")
                           StatefulKnowledgeSession kBase1kSession2;

                           public StatefulKnowledgeSession getKBase1KSession2() {
                               return kBase1kSession2;
                           }
                       }

                                                                        java code




Friday, April 19, 13
<?xml version="1.0" encoding="UTF-8"?>
                                    <kmodule
                                            xmlns="http://jboss.org/kie/6.0.0/kmodule">

                                        <kbase name="cdiexample">
                                            <ksession name="ksession1"/>
                                        </kbase>

                                    </kmodule>


                                                               meta-inf/kmodule.xml



                       <?xml version="1.0" encoding="UTF-8"?>
                       <kmodule




cdi
                               xmlns="http://jboss.org/kie/6.0.0/kmodule">

                           <kbase name="cdiexamplewithinclusion" includes="cdiexample">
                               <ksession name="ksession2"/>
                           </kbase>

                       </kmodule>


                                                 inclusion (pom.xml dependency)




Friday, April 19, 13
errai gwt
                                   cdi best-practices
                                   jee java
                            scalability dev tools (ide)
                       (template) html legacy



uberfire
Friday, April 19, 13
database


+git
Friday, April 19, 13
shameless self promotion

             building world class
             web consoles using
             uberfire  auditorium 4
                               saturday, april 20th




Friday, April 19, 13
that’s
all folks!
Friday, April 19, 13
questions?
Friday, April 19, 13
thanks!
                                                     porcelli@redhat.com
                                                           @porcelli
                                                         #guvnordev
                                                         #droolsdev
                                                          #jbpmdev
                            Alexandre Porcelli
                                                      #optaplanner-dev
                       Principal Software Engineer




Friday, April 19, 13

Mais conteúdo relacionado

Mais de Alexandre Porcelli

Running rules and processes in the cloud
Running rules and processes in the cloudRunning rules and processes in the cloud
Running rules and processes in the cloudAlexandre Porcelli
 
Impulsione sua carreira contribuindo para projetos open source
Impulsione sua carreira contribuindo para projetos open sourceImpulsione sua carreira contribuindo para projetos open source
Impulsione sua carreira contribuindo para projetos open sourceAlexandre Porcelli
 
noSQL e ORM, será que dá samba?
noSQL e ORM, será que dá samba?noSQL e ORM, será que dá samba?
noSQL e ORM, será que dá samba?Alexandre Porcelli
 
noSQL - Uma nova escola de pensamento
noSQL - Uma nova escola de pensamentonoSQL - Uma nova escola de pensamento
noSQL - Uma nova escola de pensamentoAlexandre Porcelli
 
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?SQL, NoSQL ou NewSQL: Onde armazenar meus dados?
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?Alexandre Porcelli
 
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...Alexandre Porcelli
 
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em JavaJ1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em JavaAlexandre Porcelli
 
ANTLR Conference - OpenSpotLight driven by ANTLR
ANTLR Conference - OpenSpotLight driven by ANTLRANTLR Conference - OpenSpotLight driven by ANTLR
ANTLR Conference - OpenSpotLight driven by ANTLRAlexandre Porcelli
 
Antlr Conference Drools & Hibernate
Antlr Conference   Drools & HibernateAntlr Conference   Drools & Hibernate
Antlr Conference Drools & HibernateAlexandre Porcelli
 

Mais de Alexandre Porcelli (15)

Dawn of the citizen developer
Dawn of the citizen developerDawn of the citizen developer
Dawn of the citizen developer
 
Running rules and processes in the cloud
Running rules and processes in the cloudRunning rules and processes in the cloud
Running rules and processes in the cloud
 
Impulsione sua carreira contribuindo para projetos open source
Impulsione sua carreira contribuindo para projetos open sourceImpulsione sua carreira contribuindo para projetos open source
Impulsione sua carreira contribuindo para projetos open source
 
noSQL e ORM, será que dá samba?
noSQL e ORM, será que dá samba?noSQL e ORM, será que dá samba?
noSQL e ORM, será que dá samba?
 
noSQL - Uma nova escola de pensamento
noSQL - Uma nova escola de pensamentonoSQL - Uma nova escola de pensamento
noSQL - Uma nova escola de pensamento
 
noSQL @ MSTechDay São Paulo
noSQL @ MSTechDay São PaulonoSQL @ MSTechDay São Paulo
noSQL @ MSTechDay São Paulo
 
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?SQL, NoSQL ou NewSQL: Onde armazenar meus dados?
SQL, NoSQL ou NewSQL: Onde armazenar meus dados?
 
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...
A importância dos dados em sua arquitetura... uma visão muito além do SQL Ser...
 
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em JavaJ1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
J1Brasil: Persistência de Dados além do JPA, ou Como usar noSQL em Java
 
noSQL WTF?! - Citi2010
noSQL WTF?! - Citi2010noSQL WTF?! - Citi2010
noSQL WTF?! - Citi2010
 
noSQL @ QCon SP
noSQL @ QCon SPnoSQL @ QCon SP
noSQL @ QCon SP
 
noSQL além do buzz
noSQL além do buzznoSQL além do buzz
noSQL além do buzz
 
OpenSpotLight - Concepts
OpenSpotLight - ConceptsOpenSpotLight - Concepts
OpenSpotLight - Concepts
 
ANTLR Conference - OpenSpotLight driven by ANTLR
ANTLR Conference - OpenSpotLight driven by ANTLRANTLR Conference - OpenSpotLight driven by ANTLR
ANTLR Conference - OpenSpotLight driven by ANTLR
 
Antlr Conference Drools & Hibernate
Antlr Conference   Drools & HibernateAntlr Conference   Drools & Hibernate
Antlr Conference Drools & Hibernate
 

Último

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sectoritnewsafrica
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 

Último (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
4. Cobus Valentine- Cybersecurity Threats and Solutions for the Public Sector
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 

JUDCon São Paulo - Drools in a Nutshell

  • 2. Drools in a nutshell Everything you always wanted to know but didn't know whom to ask! ;) Friday, April 19, 13
  • 3. porcelli@redhat.com no:sql(br) @porcelli rcelli Alexandre Porcelli Program Committee Alexandre Porcelli Program Committee Emerging Languages on the JVM Alexandre Porcelli Core Engineer #guvnordev Alexandre Porcelli #droolsdev Principal Software Engineer #jbpmdev #optaplanner-dev Friday, April 19, 13
  • 4. Drools? was born as a rule engine ... evolved as business modeling solution ... targets as knowledge representation and reasoning platform! Friday, April 19, 13
  • 5. opta expert fusion guvnor planner jbpm jbpm jbpm console designer Friday, April 19, 13
  • 6. expert guvnor Friday, April 19, 13
  • 7. so... what? Friday, April 19, 13
  • 8. Logic and Data Separation Speed and Scalability Understandable Rules Centralization of Knowledge Declarative Programming Friday, April 19, 13
  • 9. rule what is Friday, April 19, 13
  • 10. rule <rule_name> <attribute><value> when <conditions> then <actions> end Friday, April 19, 13
  • 11. rule "Infer Adult" when $p : Person( age >= 18 ) then System.out.println("Adult!"); end Friday, April 19, 13
  • 12. patternmatching Person( age >= 18 ) field name restriction object type constraint pattern Friday, April 19, 13
  • 13. rule "Infer Child" rule "Infer Baby" when when Person( age < 18 ) Person( age <= 2 ) then then //code //code end end rule "Infer Adult" rule "Infer Senior" when when Person( age >= 18 ) Person( age >= < 60 ) then then //code //code end end Friday, April 19, 13
  • 14. Person(age=10) rule "Infer Child" rule "Infer Baby" when when Person( age < 18 ) Person( age <= 2 ) then then //code //code end end rule "Infer Adult" rule "Infer Senior" when when Person( age >= 18 ) Person( age >= < 60 ) then then //code //code end end Friday, April 19, 13
  • 15. Person(age=22) rule "Infer Child" rule "Infer Baby" when when Person( age < 18 ) Person( age <= 2 ) then then //code //code end end rule "Infer Adult" rule "Infer Senior" when when Person( age >= 18 ) Person( age >= < 60 ) then then //code //code end end Friday, April 19, 13
  • 16. Person(age=61) rule "Infer Child" rule "Infer Baby" when when Person( age < 18 ) Person( age <= 2 ) then then //code //code end end rule "Infer Adult" rule "Infer Senior" when when Person( age >= 18 ) Person( age >= < 60 ) then then //code //code end end Friday, April 19, 13
  • 17. Person(age=1) rule "Infer Child" rule "Infer Baby" when when Person( age < 18 ) Person( age <= 2 ) then then //code //code end end rule "Infer Adult" rule "Infer Senior" when when Person( age >= 18 ) Person( age >= < 60 ) then then //code //code end end Friday, April 19, 13
  • 18. OtherObject() rule "Infer Child" rule "Infer Baby" when when Person( age < 18 ) Person( age <= 2 ) then then //code //code end end rule "Infer Adult" rule "Infer Senior" when when Person( age >= 18 ) Person( age >= < 60 ) then then //code //code end end Friday, April 19, 13
  • 19. decouple logic rule "Infer Child" rule "Infer Adult" when when $p : Person( age < 18 ) $p : Person( age >= 18 ) then then insertLogical( new IsChild( $p ) ) insertLogical( new IsAdult( $p ) ) end end rule "Issue Child Bus Pass" rule "Issue Adult Bus Pass" when when $p : Person( ) $p : Person( ) IsChild( person == $p ) IsAdult( person =$p ) then then insertLogical( new ChildBusPass( $p ) ); insertLogical( new AdultBusPass( $p ) ); end end Friday, April 19, 13
  • 20. patternmatching Person( $age : age ) Person( age == ( $age + 1 ) ) Person( age > 30 && < 40 || hair in ("black", "brown") ) Person( pets contains $rover ) Person( pets["rover"].type == "dog" ) Person( insurance.valid ) Friday, April 19, 13
  • 21. under the hood Friday, April 19, 13
  • 22. hybrid reasoning system Friday, April 19, 13
  • 24. forward backward chainning Friday, April 19, 13
  • 26. forwardchainning data driven/reactionary rule "Adults that like cheddar" when Cheese( $cheddar : name == "cheddar" ) $p : Person( age >= 18, favouriteCheese == $cheddar ) then System.out.println( $p.getName() + " likes cheddar!"); end Friday, April 19, 13
  • 27. backwardchainning goal driven declare Parent declare Man declare Woman parent : String name : String name : String child : String end end end query man( String name ) Man( name := name ) end query woman( String name ) Woman( name := name ) end query parent( String parent, String child ) Parent( parent := parent, child := child ) end Friday, April 19, 13
  • 28. backwardchainning query father( String father, String child ) ?man( father; ) ?parent( father, child; ) end query mother( String mother, String child ) ?woman( mother; ) ?parent( mother, child; ) end query son( String son, String parent ) ?man( son; ) ?parent( parent, son; ) end query daughter( String daughter, String parent ) ?woman( daughter; ) ?parent( parent, daughter; ) end Friday, April 19, 13
  • 29. backwardforward fewer hypotheses lot’s hypotheses query data lot’s data upfront Friday, April 19, 13
  • 30. rete algorithm Friday, April 19, 13
  • 31. reteoo rule "Like cheddar" when Cheese( $cheddar : name == "cheddar" ) $p : Person( favouriteCheese == $cheddar ) then System.out.println( $p.getName() + " likes cheddar" ); end rule "NOT Like cheddar" when Cheese( $cheddar : name == "cheddar" ) $p : Person( favouriteCheese != $cheddar ) then System.out.println( $p.getName() + " not like cheddar" ); end Friday, April 19, 13
  • 32. reteoo rete node object type node alpha node left input node join node terminal Friday, April 19, 13
  • 33. reteoo rete node object type node alpha node left input node join node terminal Friday, April 19, 13
  • 34. reteoo rete node object type node alpha node left input node join node terminal Friday, April 19, 13
  • 35. reteoo rete node object type node alpha node left input node join node terminal Friday, April 19, 13
  • 36. so... how? Friday, April 19, 13
  • 38. codeapi final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); // this will parse and compile in one step kbuilder.add( ResourceFactory.newClassPathResource("HelloWorld.drl", HelloWorldExample.class), ResourceType.DRL); // Check the builder for errors if ( kbuilder.hasErrors() ) { throw new RuntimeException("Error compiling."); } // get the compiled packages (which are serializable) final Collection<KnowledgePackage> pkgs = kbuilder.getKnowledgePackages(); // add the packages to a KnowledgeBase (deploy the knowledge packages). final KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(pkgs); Friday, April 19, 13
  • 39. codeapi final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); ksession.setGlobal( "myGlobalObj", globalObj ); for( Object fact : _facts_ ) { ksession.insert( fact ); } ksession.fireUntilHalt(); ksession.fireAllRules(); SessionEntryPoint entryPoint = ksession.getEntryPoint( "entrypoint_name" ); ksession.dispose(); entryPoint.insert( _fact_ ); Friday, April 19, 13
  • 40. codeapi final StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession(); ksession.execute( _facts_ ); Friday, April 19, 13
  • 41. please one sec! Friday, April 19, 13
  • 43. new paradigm? Friday, April 19, 13
  • 45. yes you can construct your systems using almost only rules! Friday, April 19, 13
  • 46. pong demo Friday, April 19, 13
  • 47. no you can adapt your existing systems (few lines) to take advantage of drools Friday, April 19, 13
  • 48. public void aprovarPagamento(String apoliceId, String sinistroId, " " int valor, String cpfAprovador) { " if (!existeReserva(sinistroId)) { " " throw new IllegalStateException( " " " " "não existe reserva para o sinistro."); " } " Pessoa aprovador = pessoaService.buscarPessoa(cpfAprovador); " if (aprovador.getPapeis() " " " .contains(Pessoa.Papeis.COORDENADOR_SEGURADORA) " " " || aprovador.getPapeis().contains( " " " " " Pessoa.Papeis.GERENTE_SEGURADORA) " " " || aprovador.getPapeis().contains( " " " " " Pessoa.Papeis.DIRETOR_SEGURADORA) " " " || aprovador.getPapeis().contains(Pessoa.Papeis.VP_SEGURADORA)) { " " if (valor <= 5000) { " " " pagar(apoliceId, sinistroId, valor); " " } else if (valor > 500000) { " " " if (aprovador.getPapeis().contains(Pessoa.Papeis.VP_SEGURADORA)) { " " " " pagar(apoliceId, sinistroId, valor); " " " } else { " " " " throw new IllegalStateException( " " " " " " "Aprovador não tem alçada para aprovação."); " " " } " " } else if (valor <= 10000) { " " " if (aprovador.getPapeis().contains( " " " " " Pessoa.Papeis.GERENTE_SEGURADORA) " " " " " || aprovador.getPapeis().contains( " " " " " " " Pessoa.Papeis.DIRETOR_SEGURADORA) " " " " " || aprovador.getPapeis().contains( " " " " " " " Pessoa.Papeis.VP_SEGURADORA)) { " " " " pagar(apoliceId, sinistroId, valor); " " " } else { " " " " throw new IllegalStateException( " " " " " " "Aprovador não tem alçada para aprovação."); " " " } " " } else if (valor <= 500000) { " " " if (aprovador.getPapeis().contains( " " " " " Pessoa.Papeis.DIRETOR_SEGURADORA) " " " " " || aprovador.getPapeis().contains( " " " " " " " Pessoa.Papeis.VP_SEGURADORA)) { " " " " pagar(apoliceId, sinistroId, valor); " " " } else { " " " " throw new IllegalStateException( " " " " " " "Aprovador não tem alçada para aprovação."); " " " } " " } else { " " " throw new IllegalStateException("Problemas na aprovação."); " " } " } else { " " throw new IllegalStateException( " " " " "Aprovador não é funcionário da seguradora."); " } } Friday, April 19, 13
  • 49. system control flow control flow control flow business rules business rules business rules control flow control flow control flow business rules business rules business rules business rules business rules business rules control flow control flow control flow business rules business rules business rules Friday, April 19, 13
  • 50. public void aprovarPagamento( String apoliceId, String sinistroId, int valor, String cpfAprovador ) { if ( !existeReserva( sinistroId ) ) { throw new IllegalStateException( "Não existe reserva para o sinistro." ); } final Pessoa aprovador = pessoaService.buscarPessoa( cpfAprovador ); final ValorPagamentoApolice pagamento = new ValorPagamentoApolice( ... ); ksession.execute( asList( aprovador, pagamento ) ); if ( !pagamento.isPago() ) { throw new IllegalArgumentException( "Pagamento nao efetuado." ); } } Friday, April 19, 13
  • 51. rule "Coordenador tentando fraudar" " when " " p: Pessoa ( papeis contains Pessoa.Papeis.COORDENADOR_SEGURADORA ) " " v: ValorPagamentoApolice( valor > 50000 ) " " f: FinanceiroService( ) " then " System.out.println("O coordenador tentou fazer um pagamento não autorizado"); " " retract( f ); end rule "VP" " when " " m : Pessoa( papeis contains Pessoa.Papeis.VP_SEGURADORA ) " " v: ValorPagamentoApolice( valor > 500000 ) " " f: FinanceiroService( ) " then " executar(f, v); " " retract( f ); end rule "Nenhum funcionario pode aprovar sua apolice" salience 8888 " when " " p : Pessoa( $cpfPessoa: cpf ) " " v: ValorPagamentoApolice( cpfSefurado == $cpfPessoa, valor >= 50000 ) " " f: FinanceiroService( ) " then " System.out.println("O profissional tentou aprovar sua apolice."); " retract( f ); rule "Diretor ou VP" end " when " " m : Pessoa( papeis contains Pessoa.Papeis.DIRETOR_SEGURADORA || " " " " " papeis contains Pessoa.Papeis.VP_SEGURADORA ) " " v: ValorPagamentoApolice( valor > 10000 && <= 500000 ) " " f: FinanceiroService( ) " then " executar(f, v); " " retract( f ); end Friday, April 19, 13
  • 52. system control flow control flow control flow business rules business rules business rules control flow control flow control flow business rules business rules business rules business rules business rules business rules control flow control flow control flow business rules guvnor Friday, April 19, 13
  • 54. business analyst write rules? Friday, April 19, 13
  • 56. no they won’t do this: rule "NOT Like cheddar" when Cheese( $cheddar : name == "cheddar" ) $p : Person( favouriteCheese != $cheddar ) then System.out.println( $p.getName() + " not like cheddar" ); end technical rule Friday, April 19, 13
  • 57. yes but they can do this: decision table Friday, April 19, 13
  • 58. yes and this test scenario Friday, April 19, 13
  • 59. so... next? Friday, April 19, 13
  • 61. retewilldie http://blog.athico.com/2013/01/life-beyond-rete-rip-rete-2013.html phreak Friday, April 19, 13
  • 62. maven compatible project structure kjar Friday, April 19, 13
  • 63. KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession("ksession2"); kSession.setGlobal("out", out); kSession.insert(new Message("Dave", "Hello, HAL. Do you read me, HAL?")); kSession.fireAllRules(); newapi Friday, April 19, 13 java code
  • 64. public class KProject { @Inject @KBase("fol4.test1.KBase1") KnowledgeBase kBase1; public KnowledgeBase getKBase1() { return kBase1; } @Inject @KBase("fol4.test2.KBase2") KnowledgeBase kBase2; public KnowledgeBase getKBase2() { return kBase2; } @Inject @KSession("fol4.test1.KSession1") StatelessKnowledgeSession kBase1kSession1; cdi public StatelessKnowledgeSession getKBase1KSession1() { return kBase1kSession1; } @Inject @KSession("fol4.test1.KSession2") StatefulKnowledgeSession kBase1kSession2; public StatefulKnowledgeSession getKBase1KSession2() { return kBase1kSession2; } } java code Friday, April 19, 13
  • 65. <?xml version="1.0" encoding="UTF-8"?> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"> <kbase name="cdiexample"> <ksession name="ksession1"/> </kbase> </kmodule> meta-inf/kmodule.xml <?xml version="1.0" encoding="UTF-8"?> <kmodule cdi xmlns="http://jboss.org/kie/6.0.0/kmodule"> <kbase name="cdiexamplewithinclusion" includes="cdiexample"> <ksession name="ksession2"/> </kbase> </kmodule> inclusion (pom.xml dependency) Friday, April 19, 13
  • 66. errai gwt cdi best-practices jee java scalability dev tools (ide) (template) html legacy uberfire Friday, April 19, 13
  • 68. shameless self promotion building world class web consoles using uberfire auditorium 4 saturday, april 20th Friday, April 19, 13
  • 71. thanks! porcelli@redhat.com @porcelli #guvnordev #droolsdev #jbpmdev Alexandre Porcelli #optaplanner-dev Principal Software Engineer Friday, April 19, 13