viernes, 25 de enero de 2013

Drools 5.0 - Read rules



Another form to read the Droools rules is through a FileInputStream


                KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder();

FileInputStream  fis = new FileInputStream(url);
kbuilder.add(ResourceFactory.newInputStreamResource(fis), ResourceType.DTABLE);

KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
for (KnowledgeBuilderError error : errors) {
System.err.println(error);
}
throw new IllegalArgumentException("Could not parse knowledge.");
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;

Instead of

             kbuilder.add(ResourceFactory.newClassPathResource(url), ResourceType.DRL);

lunes, 7 de enero de 2013

PrimeFaces - Mobile

 To implement PrimeFaces for mobile you have to do some changes to the implementation.

  1. POM
    • Add this repository & dependencies
      <repository>
               <id>prime-repo</id>
               <name>Prime Repo</name>
                <url>http://repository.primefaces.org</url>   
               <layout>default</layout>
      </repository>
      <dependency>
               <groupId>org.primefaces</groupId>
               <artifactId>primefaces</artifactId>
               <version>3.3</version>
      </dependency>
      <dependency>
               <groupId>org.primefaces</groupId>
               <artifactId>primefaces-mobile</artifactId> 
              <version>0.9.3</version>
      </dependency>

  1. FACES-CONFIG.xml

    • Add in the tag<application>
    • <application> 
               <default-render-kit-id>PRIMEFACES_MOBILE</default-render-kit-id> 
      </application>



  1. XHTML
    • Add in the libraries xmlns:pm="http://primefaces.org/mobile"
    •  
    • Insert the tag <f:view> instead of <h:body>
    • <f:view xmlns:pm="http://primefaces.org/mobile" contentType="text/html" renderKitId="PRIMEFACES_MOBILE">
    • Insert the tag <pm:page>
    • <pm:page title="Title page">
    • Insert the tag <pm:view>
    • <pm:view id="main">
       
    • If you want to display a header in the page, insert <pm:header>
    • <pm:header title="Mobile" swatch="b"/>
      • There are 5 themes (swatch values): "a", "b", "c", "d", "e"
       
    • In the <p:inputText> there is an attribute label, so you don´t have to user the <h:outputLabel> element  
    • The nature of the tag <f:facet> in different
    •  
    • The tag <p:dataList> works better than  <p:dataTable>







JSF - Theme

This web site is for design your own themes =)

http://jquerymobile.com/themeroller/



Oracle BPM - Oracle WebLogic Server



  1. Install DB (wls1035_win32.exe)
  2. Welcome Screen -> Next
  3. Choose Middleware Home Directory Screen 
    • Select Create a new Middleware Home.  -> Next
  4. Register for Security Updates Screen -> Next
  5. Choose Install Type Screen
    • Select Typical-> Next
  6. Choose Product Installation Directories Screen -> Next
  7. Choose Shortcut Location (Windows only) -> Next
  8. Installation Summary Screen -> Next
  9. Installation Complete Screen 
    • De-select Run Quickstart. -> Done


viernes, 4 de enero de 2013

Oracle BPM - RCU



  1. Install DB (OracleXE112_Win32)
  2. Install the RCU (ofm_rcu_win_11.1.1.5.0_disk1_1of1.zip)  
    1. Unzip in path C:\ to avoid the message error Windows cannot find 'C:\Documents'. 
    2. Create the environment variable RCU_JDBC_TRIM_BLOCKS with value TRUE

    3. Setup steps
      1. Welcome Screen -> Next
      2. Create Repository Screen -> Next
      3. Database Connection Details Screen -> Next  (Accept the warning)
        • Host Name: localhost     Ex. ora-node1-vip.example.com
        • Port: 1521 by default
        • Database Name: xe
        • User: SYS
        • Pwd: Has to be the password from the DB
        • Role: for user SYS the role has to be SYSDBA role
      4. Select Components Screen
      5. Schema Passwords Screen
        1. Select Use same password for all schemas.
        2. Type password
      6. Map Tablespaces Screen -> Next
      7. Summary Screen -> Create -> Next
      8. Completion Summary Screen -> Close

You has finished your RCU installation =)


















Oracle BPM - Errors


Error: 
Current Value: 100,  it should be greater than or equal to 200.


Solution:


  • Login on your database with system user.

            SQL> connect system
            Enter password: 
            Connected.



  • Type:
    • show parameters processes (which will show the current value of processes).
    • ALTER SYSTEM SET PROCESSES=200 SCOPE=SPFILE;
    • show parameters open_cursors (which will show the current value of open_cursors).
    • ALTER SYSTEM SET OPEN_CURSORS=200 SCOPE=SPFILE;
  • Restart DB.