/// <summary> /// Create the factory's builder. This implementation takes the /// <code>de.odysseus.el.tree.TreeBuilder</code> property as a name of a class implementing the /// <code>de.odysseus.el.tree.TreeBuilder</code> interface. If the property is not set, a plain /// <code>de.odysseus.el.tree.impl.Builder</code> is used. If the configured class is a subclass /// of <code>de.odysseus.el.tree.impl.Builder</code> and which provides a constructor taking an /// array of <code>Builder.Feature</code>, this constructor will be invoked. Otherwise, the /// default constructor will be used. /// </summary> protected internal virtual TreeBuilder CreateTreeBuilder(Core.Model.Properties properties, params Builder.Feature[] features) { Type clazz = Load(typeof(TreeBuilder)); //if (clazz == null) //{ return(new Builder(features)); //} //try //{ // if (clazz.IsSubclassOf(typeof(Builder))) // { // Constructor<object> constructor = clazz.GetConstructor(typeof(Builder.Feature[])); // if (constructor == null) // { // if (features == null || features.Length == 0) // { // return typeof(TreeBuilder).Cast(clazz.NewInstance()); // } // else // { // throw new ELException("Builder " + clazz + " is missing constructor (can't pass features)"); // } // } // else // { // return typeof(TreeBuilder).Cast(constructor.NewInstance((object) features)); // } // } // else // { // return typeof(TreeBuilder).Cast(clazz.NewInstance()); // } //} //catch (Exception e) //{ // throw new ELException("TreeBuilder " + clazz + " could not be instantiated", e); //} }
/// <summary> /// Create a new expression factory using the default builder and cache implementations. The /// builder and cache are configured using the specified profile and properties. The maximum /// cache size will be 1000 unless overridden by property <code>javax.el.cacheSize</code>. /// </summary> /// <param name="profile"> /// builder profile (individual features may be overridden in properties) </param> /// <param name="properties"> /// used to initialize this factory (may be <code>null</code>) </param> /// <param name="converter"> /// custom type converter /// /// </param> public ExpressionFactoryImpl(Profile profile, Core.Model.Properties properties, ITypeConverter converter) { this.store = CreateTreeStore(1000, profile); this.converter = converter; }
/// <summary> /// Create a new expression factory using the default builder and cache implementations. The /// builder and cache are configured using the specified properties. The maximum cache size will /// be 1000 unless overridden by property <code>javax.el.cacheSize</code>. The builder profile is /// <seealso cref="Profile#JEE6"/> (individual features may be overridden in <code>properties</code>). /// </summary> /// <param name="properties"> /// used to initialize this factory (may be <code>null</code>) </param> /// <param name="converter"> /// custom type converter </param> public ExpressionFactoryImpl(Core.Model.Properties properties, ITypeConverter converter) : this(Profile.JEE6, properties, converter) { }
/// <summary> /// Create a new expression factory using the default builder and cache implementations. The /// builder and cache are configured using the specified properties. The maximum cache size will /// be 1000 unless overridden by property <code>javax.el.cacheSize</code>. The builder profile is /// <seealso cref="Profile#JEE6"/> (features may be overridden in <code>properties</code>). /// </summary> /// <param name="properties"> /// used to initialize this factory (may be <code>null</code>) </param> public ExpressionFactoryImpl(Core.Model.Properties properties) : this(Profile.JEE6, properties) { }
//解析xml 生成ProcessDefinitionEntity protected internal override IList <ProcessDefinitionEntity> TransformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Core.Model.Properties properties) { byte[] bytes = resource.Bytes; System.IO.MemoryStream inputStream = new System.IO.MemoryStream(bytes); BpmnParse bpmnParse = bpmnParser.CreateBpmnParse().SourceInputStream(inputStream).Deployment(deployment).SetName(resource.Name); if (!deployment.IsValidatingSchema) { bpmnParse.SchemaResource = null; } //执行实际解析 bpmnParse.Execute(); //TODO 解析后续行为 if (!properties.Contains(JobDeclarationsProperty)) { properties.Set(JobDeclarationsProperty, new Dictionary <string, IList <IJobDeclaration> >()); } var oldProperties = properties.Get(JobDeclarationsProperty); foreach (var item in bpmnParse.GetJobDeclarations()) { oldProperties[item.Key] = item.Value; } //foreach (var item in oldProperties) //{ // bpmnParse.JobDeclarations[item.Key] = item.Value; //} //properties.Set<string, IList<IJobDeclaration>>(JobDeclarationsProperty, bpmnParse.JobDeclarations); return(bpmnParse.ProcessDefinitions); }
protected internal override void HandlePersistedDefinition(ESS.FW.Bpm.Engine.Persistence.Entity.ProcessDefinitionEntity definition, ESS.FW.Bpm.Engine.Persistence.Entity.ProcessDefinitionEntity persistedDefinition, DeploymentEntity deployment, Core.Model.Properties properties) { //check if persisted definition is not null, since the process definition can be deleted by the user //in such cases we don't want to handle them //we can't do this in the parent method, since other siblings want to handle them like {@link DecisionDefinitionDeployer} if (persistedDefinition != null) { base.HandlePersistedDefinition(definition, persistedDefinition, deployment, properties); } }
protected internal override void DefinitionAddedToDeploymentCache(DeploymentEntity deployment, ProcessDefinitionEntity definition, Core.Model.Properties properties) { IList <IJobDeclaration> declarations; properties.Get(JobDeclarationsProperty).TryGetValue(definition.Key, out declarations); //var obj = properties.Get(JobDeclarationsProperty); //IList<IJobDeclaration> declarations =obj.ContainsKey(definition.Key)?obj[definition.Key]:null; UpdateJobDeclarations(declarations, definition, deployment.IsNew); ProcessDefinitionEntity latestDefinition = FindLatestDefinitionByKeyAndTenantId(definition.Key, definition.TenantId); if (deployment.IsNew) { AdjustStartEventSubscriptions(definition, latestDefinition); } // add "authorizations" AddAuthorizations(definition); }