class WorkflowResource {

    public Double getWorkflowVersionFromArtifactName(String artifactName) {
        if (artifactName == null) {
            return null;
        } else {
            String[] workflowNameParts = null;
            if (artifactName.contains(BPMN_SUFFIX)) {
                workflowNameParts = artifactName.substring(0, artifactName.lastIndexOf(BPMN_SUFFIX)).split("-");
            } else {
                workflowNameParts = artifactName.split("-");
            }
            if (workflowNameParts.length < 2) {
                return null;
            } else {
                return Double.valueOf(workflowNameParts[1].replaceAll("_", "."));
            }
        }
    }

}