2. Yes, you can just use Hibernate HQL (or SQL if you really need to)
thanks Joram Barrez for the respones.
but how to write my own hql in a custom activity?
Take a look at the implementation of the HQLActivity (og.jbpm.jpdl.internal.activity.HqlActivity)
You can do something like this:
Session session = environment.get(Session.class);
Query q = createQuery(session);