AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer();
try
{
Workflow workflowInit = new BasicWorkflow(infoGluePrincipal.getName());
long id = workflowInit.initialize("MattiasWF", 1, new HashMap());
logger.info("Workflow initialized....");
logger.info("id:" + id);
logger.info("name:" + workflowInit.getWorkflowName(id));
Workflow workflow = workflowInit; //new BasicWorkflow(infoGluePrincipal.getName());
int[] actions = workflow.getAvailableActions(id, null);
logger.info("actions:" + actions.length);
WorkflowDescriptor wd = workflow.getWorkflowDescriptor(workflow.getWorkflowName(id));
for (int i = 0; i < actions.length; i++)
{
int availableActionId = actions[i];
String name = wd.getAction(availableActionId).getName();
logger.info("Action:" + availableActionId + ":" + name);
//workflow.doAction(id, availableActionId, Collections.EMPTY_MAP);
}
Map map = new HashMap();
map.put("userName", "Mattias");
workflow.doAction(id, 1, map);
actions = workflow.getAvailableActions(id, null);
logger.info("actions:" + actions.length);
wd = workflow.getWorkflowDescriptor(workflow.getWorkflowName(id));
for (int i = 0; i < actions.length; i++)
{
int availableActionId = actions[i];
String name = wd.getAction(availableActionId).getName();