Workflowable workflowable = WorkflowUtil.getWorkflowable(this.manager,
getSession(), getLogger(), doc);
resolver = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
if (resolver.hasWorkflow(workflowable)) {
Workflow workflow = resolver.getWorkflowSchema(workflowable);
String[] variableNames = workflow.getVariableNames();
Version latestVersion = workflowable.getLatestVersion();
Boolean isLive = null;
if (latestVersion != null) {
setParameter(STATE, latestVersion.getState());
if (Arrays.asList(variableNames).contains(WORKFLOW_VARIABLE_ISLIVE)) {
isLive = Boolean.valueOf(latestVersion
.getValue(WORKFLOW_VARIABLE_ISLIVE));
}
} else {
setParameter(STATE, workflow.getInitialState());
if (Arrays.asList(variableNames).contains(WORKFLOW_VARIABLE_ISLIVE)) {
isLive = Boolean.valueOf(workflow
.getInitialValue(WORKFLOW_VARIABLE_ISLIVE));
}
}
setParameter(ISLIVE, isLive);
} else {