package org.drools.builder;

public enum ResourceType {
    /** Drools Rule Language */
    DRL,

    /** Drools XML Rule Language */
    XDRL,

    /** Drools DSL */
    DSL,

    /** Drools DSL Rule */
    DSLR,

    /** Drools Rule Flow Language */
    DRF,

    /** Decision Table */
    DTABLE,

    /** Binary Package */
    PKG,

    /** ChangeSet */
    ChangeSet;
}

@@ -28,374 +28,2197 @@
 %0D%0A%0D%0A
-public enum ResourceType %7B%0D%0A    /** Drools Rule Language */%0D%0A    DRL,%0D%0A%0D%0A    /** Drools XML Rule Language */%0D%0A    XDRL,%0D%0A%0D%0A    /** Drools DSL */%0D%0A    DSL,%0D%0A%0D%0A    /** Drools DSL Rule */%0D%0A    DSLR,%0D%0A%0D%0A    /** Drools Rule Flow Language */%0D%0A    DRF,%0D%0A%0D%0A    /** Decision Table */%0D%0A    DTABLE,%0D%0A%0D%0A    /** Binary Package */%0D%0A    PKG,%0D%0A%0D%0A    /** ChangeSet */%0D%0A    ChangeSet;
+import java.util.Collections;%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.Map;%0D%0A%0D%0Apublic class ResourceType %7B%0D%0A%09%0D%0A%09private String name;%0D%0A%09%0D%0A    private static final Map%3CString, ResourceType%3E CACHE = Collections.synchronizedMap( new HashMap%3CString, ResourceType%3E() );%0D%0A%0D%0A    public ResourceType(String name) %7B%0D%0A%09%09this.name = name;%0D%0A%09%7D%0D%0A%09%0D%0A    public static ResourceType addResourceTypeToRegistry(final String resourceType) %7B%0D%0A%09%09ResourceType resource = new ResourceType(resourceType);%0D%0A%09%09CACHE.put(resourceType, resource);%0D%0A%09%09return resource;%0D%0A%09%7D%0D%0A%0D%0A    /** Drools Rule Language */%0D%0A    public static final ResourceType DRL = addResourceTypeToRegistry(%22DRL%22);%0D%0A%0D%0A    /** Drools XML Rule Language */%0D%0A    public static final ResourceType XDRL = addResourceTypeToRegistry(%22XDRL%22);%0D%0A%0D%0A    /** Drools DSL */%0D%0A    public static final ResourceType DSL = addResourceTypeToRegistry(%22DSL%22);%0D%0A%0D%0A    /** Drools DSL Rule */%0D%0A    public static final ResourceType DSLR = addResourceTypeToRegistry(%22DSLR%22);%0D%0A%0D%0A    /** Drools Rule Flow Language */%0D%0A    public static final ResourceType DRF = addResourceTypeToRegistry(%22DRF%22);%0D%0A%0D%0A    /** Decision Table */%0D%0A    public static final ResourceType DTABLE = addResourceTypeToRegistry(%22DTABLE%22);%0D%0A%0D%0A    /** Binary Package */%0D%0A    public static final ResourceType PKG = addResourceTypeToRegistry(%22PKG%22);%0D%0A%0D%0A    /** ChangeSet */%0D%0A    public static final ResourceType ChangeSet = addResourceTypeToRegistry(%22ChangeSet%22);%0D%0A    %0D%0A    public static ResourceType getResourceType(final String resourceType) %7B%0D%0A    %09ResourceType resource = CACHE.get(resourceType);%0D%0A        if ( resource == null ) %7B%0D%0A            throw new RuntimeException( %22Unable to determine resource type %22 + resourceType );%0D%0A        %7D%0D%0A        return resource;%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    public int hashCode() %7B%0D%0A        return name.hashCode();%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    public boolean equals(Object obj) %7B%0D%0A        if ( this == obj ) return true;%0D%0A        if ( obj == null ) return false;%0D%0A        if ( getClass() != obj.getClass() ) return false;%0D%0A        final ResourceType other = (ResourceType) obj;%0D%0A        if ( !name.equals( other.name ) ) return false;%0D%0A        return true;%0D%0A    %7D%0D%0A    
 %0D%0A%7D%0D

Improve process persistence usability - improved command-based implementation of StatefulKnowledgeSession