Saturday, March 14, 2015

Using Custom XML Mapped Statements in Activiti

Why use MyBatis XML based Mapped Statements to execute custom SQL queries? One useful case is when SQL statements have to be separated from Java code (so that for example SQL statements can be modified without modifying Java code). Another useful case is when working with complicated statements, as mentioned in the MyBatis documentation

"The annotations are a lot cleaner for simple statements, however, Java Annotations are both limited and messier for more complicated statements. Therefore, if you have to do anything complicated, you're better off with XML mapped statements."

Saturday, November 1, 2014

Introduction to Actangular

The goal of Actangular is to provide developers using Activiti with reusable functionality that they can use in their own web applications. To achieve this goal, Actangular provides the following
  • A set of AngularJS and Javascript modules that provide client side functionality
  • Based on activiti-rest and Activiti's REST API provide extended functionality as needed (when appropriate will be contributed to activiti-rest project)
  • A reference web application that demonstrates provided functionality
What features are currently available in Actangular?
Some of the features currently available are
  • Login and logout with remember me feature support
  • Managing tasks i.e. listing, sorting, creating/editing/claiming/completing/deleting, posting comments, adding/deleting identity links, uploading attachments, etc..
  • Managing process instances i.e. listing, sorting, starting/deleting, adding/deleting identity links, listing related tasks, etc..
  • Historic tasks and process instances listing and sorting
  • Form rendering and submitting, supports string, date, boolean, and long form property types
  • Task and process instance variables, supports string, date, and long variable types
  • Managing models i.e. listing, creating/editing/deleting models
  • Modeler integration enables modeling, converting to BPMN and deploying from the Modeler
  • Process diagrams rendering using SVG (client side) and PNG (sever side)
  • Multi-language, currently English and Arabic (with RTL support)

Friday, June 11, 2010

Implementing your own Dependency Injection, Part 2

In my previous post "Implementing Your own DI", I discussed how to implement a simple dependency injection using Java Annotations and Reflection API. In this post, I will discuss about adding some extra features to the previous implementation.

The new features included are:
  • Constructor level injection.
  • Injecting methods with multi-parameters.
  • Resolve dependencies by specifying an id, if not specified use the member's name (field's name or setter method's name) instead, or by class type.
  • Dependencies can be marked as optional.
  • Adding foreign objects. Objects that are not created by this implementation but are dependencies of classes created and wired by this implementation.

Friday, May 14, 2010

Implementing your own Dependency Injection

Dependency Injection can help in improving the quality of your code. DI helps writing code that is more flexible, reusable, and easier to test. Many open source frameworks are available that provide Dependency Injection such as Spring Framework, Google Guice, PicoContainer, etc. I, personally, use Spring with most of my projects. However, in some situations you may not be able to use or may not prefer using one of these frameworks. For example, if you are writing a library for other developers to use, you would not think of using a DI framework (true in my case, I'm a member of SMSLib project). Using a DI framework in a library is not a good idea, since this widens the library's learning curve. In addition, some users may have their own DI framework that might not be compatible with the DI framework used by the library. Usually, DI frameworks are associated with IoC and are meant to be used by end developers which make use of Ioc and DI to integrate different libraries, in addition to their own code, to provide applications for end users. In these cases, where using a DI framework is not an option, you usually end up implementing your own DI for your code.

Saturday, April 4, 2009

A Simple JSF Application Using Eclipse, Maven, and Tomcat

For this example, you will need Eclipse IDE (of course, you need to have Java installed), if you don't have Eclipse, you can downloaded it here (choose the "Eclipse IDE for Java EE Developers"). You will also need Maven plugin for Eclipse, to install see here. Now, create a Dynamic Web Project from Eclipse select File-->New-->Project. Then select Web-->Dynamic Web Project