Exemplo n.º 1
0
 /// <summary>
 ///     get a resource location by convention based on a class (type) and a
 ///     relative resource name. The return value will be the full classpath
 ///     location of the type, plus a suffix built from the name parameter:
 ///     <code>BpmnDeployer.BPMN_RESOURCE_SUFFIXES</code>.
 ///     The first resource matching a suffix will be returned.
 /// </summary>
 public static string GetBpmnProcessDefinitionResource(Type type, string name)
 {
     if (name.IndexOf("_") > -1)
     {
         name = name.Split('_')[1];
     }
     foreach (var suffix in ResourceSuffixes)
     {
         var resource = CreateResourceName(type, name, suffix);
         if (!ReflectUtil.Existed(resource))
         {
             continue;
         }
         var inputStream = ReflectUtil.GetResourceAsStream(resource);
         if (inputStream == null)
         {
             continue;
         }
         return(resource);
     }
     return(CreateResourceName(type, name, BpmnDeployer.BpmnResourceSuffixes[0]));
 }