*/
public WorkflowVO invokeAction(InfoGluePrincipal principal, long workflowId, int actionId, Map inputs) throws WorkflowException
{
WorkflowVO workflowVO = null;
Session session = null;
net.sf.hibernate.Transaction tx = null;
try
{
session = hibernateSessionFactory.openSession();
tx = session.beginTransaction();
WorkflowFacade wf = new WorkflowFacade(principal, workflowId, hibernateSessionFactory, session);
wf.doAction(actionId, inputs);
session.flush();
tx.commit();
}
catch (Exception e)
{
logger.error("An error occurred when we tries to execute invokeAction():" + e.getMessage(), e);
try
{
tx.rollback();
}
catch (HibernateException he)
{
logger.error("An error occurred when we tries to rollback transaction:" + he.getMessage(), he);
}
restoreSessionFactory(e);
}
finally
{
try
{
session.close();
}
catch (HibernateException e)
{
logger.error("An error occurred when we tries to close session:" + e.getMessage(), e);
}
}
try
{
session = hibernateSessionFactory.openSession();
tx = session.beginTransaction();
WorkflowFacade wf = new WorkflowFacade(principal, workflowId, hibernateSessionFactory, session);
workflowVO = wf.createWorkflowVO();
session.flush();
tx.commit();
}
catch (Exception e)
{
logger.error("An error occurred when we tries to execute invokeAction():" + e.getMessage(), e);
try
{
tx.rollback();
}
catch (HibernateException he)
{
logger.error("An error occurred when we tries to rollback transaction:" + he.getMessage(), he);
}
restoreSessionFactory(e);
}
finally
{
try
{
session.close();
}
catch (HibernateException e)
{
logger.error("An error occurred when we tries to close session:" + e.getMessage(), e);
}