class WorkflowResource {

    public String getWorkflowNameFromArtifactName(String artifactName) {
        if (artifactName == null) {
            return null;
        } else {
            if (artifactName.contains(BPMN_SUFFIX)) {
                return artifactName.substring(0, artifactName.lastIndexOf(BPMN_SUFFIX)).split("-")[0];
            } else {
                return artifactName.split("-")[0];
            }
        }
    }

}