public void FromXml(XElement element, IFromXmlContext ctx) { this.workflow.Name = element.Attribute("Name").Value; this.workflow.MainEntityType = ctx.GetType(element.Attribute("MainEntityType").Value).RetrieveAndForget(); this.workflow.MainEntityStrategies.AssignMList(element.Attribute("MainEntityStrategies").Value.Split(",").Select(a => a.Trim().ToEnum <WorkflowMainEntityStrategy>()).ToMList()); this.workflow.ExpirationDate = element.Attribute("ExpirationDate")?.Let(ed => DateTime.ParseExact(ed.Value, "o", CultureInfo.InvariantCulture)); ctx.SaveMaybe(this.workflow); using (Sync(this.pools, element.Elements("Pool"), ctx, (pool, xml) => { pool.BpmnElementId = xml.Attribute("bpmnElementId").Value; pool.Name = xml.Attribute("Name").Value; pool.Workflow = this.workflow; SetXmlDiagram(pool, xml); })) { using (Sync(this.lanes, element.Elements("Lane"), ctx, (lane, xml) => { lane.BpmnElementId = xml.Attribute("bpmnElementId").Value; lane.Name = xml.Attribute("Name").Value; lane.Pool = this.pools.GetOrThrow(xml.Attribute("Pool").Value); lane.Actors = (xml.Element("Actors")?.Elements("Actor")).EmptyIfNull().Select(a => Lite.Parse(a.Value)).ToMList(); lane.ActorsEval = xml.Element("ActorsEval")?.Let(ae => (lane.ActorsEval ?? new WorkflowLaneActorsEval()).Do(wal => wal.Script = ae.Value)); SetXmlDiagram(lane, xml); })) { //TODO: Complete code } } }
public void FromXml(XElement element, IFromXmlContext ctx) { DisplayName = element.Attribute("DisplayName").Value; EntityType = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value)); Owner = element.Attribute("Owner")?.Let(a => Lite.Parse <Entity>(a.Value)); DashboardPriority = element.Attribute("DashboardPriority")?.Let(a => int.Parse(a.Value)); EmbeddedInEntity = element.Attribute("EmbeddedInEntity")?.Let(a => a.Value.ToEnum <DashboardEmbedededInEntity>()); Parts.Synchronize(element.Element("Parts").Elements().ToList(), (pp, x) => pp.FromXml(x, ctx)); }
public void FromXml(XElement element, IFromXmlContext ctx) { DisplayName = element.Attribute("DisplayName").Value; Query = ctx.GetQuery(element.Attribute("Query").Value); EntityType = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value)); HideQuickLink = element.Attribute("HideQuickLink")?.Let(a => bool.Parse(a.Value)) ?? false; Owner = element.Attribute("Owner")?.Let(a => Lite.Parse(a.Value)) !; Filters.Synchronize(element.Element("Filters")?.Elements().ToList(), (f, x) => f.FromXml(x, ctx)); Columns.Synchronize(element.Element("Columns")?.Elements().ToList(), (c, x) => c.FromXml(x, ctx)); Parameters.Synchronize(element.Element("Parameters")?.Elements().ToList(), (p, x) => p.FromXml(x, ctx)); ChartScript = ctx.ChartScript(element.Attribute("ChartScript").Value); ParseData(ctx.GetQueryDescription(Query)); }
public void FromXml(XElement element, IFromXmlContext ctx) { Query = ctx.TryGetQuery(element.Attribute("Query").Value); DisplayName = element.Attribute("DisplayName").Value; EntityType = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value)); Owner = element.Attribute("Owner")?.Let(a => Lite.Parse(a.Value)); WithoutFilters = element.Attribute("WithoutFilters")?.Let(a => a.Value == true.ToString()) ?? false; ElementsPerPage = element.Attribute("ElementsPerPage")?.Let(a => int.Parse(a.Value)); PaginationMode = element.Attribute("PaginationMode")?.Let(a => a.Value.ToEnum <PaginationMode>()); ColumnsMode = element.Attribute("ColumnsMode").Value.ToEnum <ColumnOptionsMode>(); Filters.Synchronize(element.Element("Filters")?.Elements().ToList(), (f, x) => f.FromXml(x, ctx)); Columns.Synchronize(element.Element("Columns")?.Elements().ToList(), (c, x) => c.FromXml(x, ctx)); Orders.Synchronize(element.Element("Orders")?.Elements().ToList(), (o, x) => o.FromXml(x, ctx)); ParseData(ctx.GetQueryDescription(Query)); }
public void FromXml(XElement element, IFromXmlContext ctx) { Query = ctx.GetQuery(element.Attribute("Query") !.Value); DisplayName = element.Attribute("DisplayName") !.Value; EntityType = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value).ToLite()); Owner = element.Attribute("Owner")?.Let(a => Lite.Parse(a.Value)) !; HideQuickLink = element.Attribute("HideQuickLink")?.Let(a => bool.Parse(a.Value)) ?? false; IncludeDefaultFilters = element.Attribute("IncludeDefaultFilters")?.Let(a => bool.Parse(a.Value)); AppendFilters = element.Attribute("AppendFilters")?.Let(a => bool.Parse(a.Value)) ?? false; GroupResults = element.Attribute("GroupResults")?.Let(a => bool.Parse(a.Value)) ?? false; ElementsPerPage = element.Attribute("ElementsPerPage")?.Let(a => int.Parse(a.Value)); PaginationMode = element.Attribute("PaginationMode")?.Let(a => a.Value.ToEnum <PaginationMode>()); ColumnsMode = element.Attribute("ColumnsMode") !.Value.ToEnum <ColumnOptionsMode>(); Filters.Synchronize(element.Element("Filters")?.Elements().ToList(), (f, x) => f.FromXml(x, ctx)); Columns.Synchronize(element.Element("Columns")?.Elements().ToList(), (c, x) => c.FromXml(x, ctx)); Orders.Synchronize(element.Element("Orders")?.Elements().ToList(), (o, x) => o.FromXml(x, ctx)); ParseData(ctx.GetQueryDescription(Query)); }
public void FromXml(XElement element, IFromXmlContext ctx) { DisplayName = element.Attribute("DisplayName").Value; Query = ctx.GetQuery(element.Attribute("Query").Value); EntityType = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value)); Owner = element.Attribute("Owner")?.Let(a => Lite.Parse(a.Value)); ChartScript = ctx.ChartScript(element.Attribute("ChartScript").Value); GroupResults = bool.Parse(element.Attribute("GroupResults").Value); Filters.Synchronize((element.Element("Filters")?.Elements()).EmptyIfNull().ToList(), (f, x) => f.FromXml(x, ctx)); Columns.Synchronize((element.Element("Columns")?.Elements()).EmptyIfNull().ToList(), (c, x) => c.FromXml(x, ctx)); Orders.Synchronize((element.Element("Orders")?.Elements()).EmptyIfNull().ToList(), (o, x) => o.FromXml(x, ctx)); Parameters.Synchronize((element.Element("Parameters")?.Elements()).EmptyIfNull().ToList(), (p, x) => p.FromXml(x, ctx)); ParseData(ctx.GetQueryDescription(Query)); }
public void FromXml(XElement element, IFromXmlContext ctx) { DisplayName = element.Attribute("DisplayName").Value; EntityType = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value)); Owner = element.Attribute("Owner")?.Let(a => Lite.Parse<Entity>(a.Value)); DashboardPriority = element.Attribute("DashboardPriority")?.Let(a => int.Parse(a.Value)); EmbeddedInEntity = element.Attribute("EmbeddedInEntity")?.Let(a => a.Value.ToEnum<DashboardEmbedededInEntity>()); Parts.Syncronize(element.Element("Parts").Elements().ToList(), (pp, x) => pp.FromXml(x, ctx)); }
public void FromXml(XElement element, IFromXmlContext ctx) { Query = ctx.GetQuery(element.Attribute("Query").Value); DisplayName = element.Attribute("DisplayName").Value; EntityType = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value)); Owner = element.Attribute("Owner")?.Let(a => Lite.Parse(a.Value)); WithoutFilters = element.Attribute("WithoutFilters")?.Let(a => a.Value == true.ToString()) ?? false; ElementsPerPage = element.Attribute("ElementsPerPage")?.Let(a => int.Parse(a.Value)); PaginationMode = element.Attribute("PaginationMode")?.Let(a => a.Value.ToEnum<PaginationMode>()); ColumnsMode = element.Attribute("ColumnsMode").Value.ToEnum<ColumnOptionsMode>(); Filters.Synchronize(element.Element("Filters")?.Elements().EmptyIfNull().ToList(), (f, x) => f.FromXml(x, ctx)); Columns.Synchronize(element.Element("Columns")?.Elements().EmptyIfNull().ToList(), (c, x) => c.FromXml(x, ctx)); Orders.Synchronize(element.Element("Orders")?.Elements().EmptyIfNull().ToList(), (o, x) => o.FromXml(x, ctx)); ParseData(ctx.GetQueryDescription(Query)); }