Aspose.Diagram Bpmn Support - FormulaU

Hi,

I am reading the structure of my visio diagram in c#, my previous version was soported by visio (interop.vision ) and now we are implementing aspose,

using interop I have this:

formulaU = shape.Cells["Prop.BpmnLoopType"].FormulaU;

how can I do using aspose for get the property?

I need:
-Prop.BpmnLoopType
-Prop.BpmnActivityType
-Prop.BpmnSubProcessType
-Prop.BpmnTaskType
-Prop.BpmnArtifactType

and others.

Thans for your help.!!!

Consu.

Hi Consu,


Thank you for considering Aspose APIs.

I am afraid, your required properties may not be available with the current set of Aspose.Diagram for .NET. We can analyze these features and log them for feasibility analysis as well as provide the implementation with future release (if required), however, we need some more information to log a formal request for the product team. Please be kind enough to share the following.

  • A sample/template file containing the aforementioned properties.
  • Snapshot(s) showing the aforementioned properties in Visio application.
  • An executable sample application showing the working of aforementioned properties with Office Interop.
Thanks for your answer.

I found the property in this part (using aspose):

foreach (Aspose.Diagram.Shape shape in page.Shapes)
{
Prop p= shape.Props.GetProp("BpmnTaskType");
if (p!= null)
formulau= p.Value.Ufev.F;
}
and the result is: = "INDEX(0,Prop.BpmnTaskType.Format)". It is good

But in some cases like this (the master is: CFF Container)...

Prop p = shape.Props.GetProp("BpmnElementType");
if (p != null)
elementTypeFormula = p.Value.Ufev.F;

the result is "Inh" .... why?.. it must be index(...???

Thanks for your answer.


I found the property in this part (using aspose):

foreach (Aspose.Diagram.Shape shape in page.Shapes)
{

Prop p= shape.Props.GetProp(“BpmnTaskType”);
if (p!= null)
ForumulaU=p.Value.Ufev.F;

}
the result is: “INDEX(0,Prop.BpmnTaskType.Format)”. It is good.

But in some cases like this (master CFF cointainer):

Prop p = shape.Props.GetProp(“BpmnElementType”);
if (p != null)
elementTypeFormula = p.Value.Ufev.F;

the result is: “Inh”.

Why? it must be INDEX(…

Thanks!!
Hi there,

Please be kind enough to share an executable sample application along with the template file in order to replicate your recently shared concerns. We will analyze the scenario and post our findings here for your reference.

Thank you for your cooperation & understanding.

Thanks for your answer,



Attachment is the project in visual studio 2015 (TestFormulaU.zip)
and the executable file(Debug.zip).

The code is :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data;
using Aspose.Diagram;
using System.IO;

namespace TestFormulaU
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}



private void readfile(string fileName)
{
DataTable dt = new DataTable();
dt.Columns.Add(new System.Data.DataColumn(“Page”, typeof(string)));
dt.Columns.Add(new System.Data.DataColumn(“Shape Master”, typeof(string)));
dt.Columns.Add(new System.Data.DataColumn(“Property Name”, typeof(string)));
dt.Columns.Add(new System.Data.DataColumn(“Shape FormulaU”, typeof(string)));


FileStream st = new FileStream(fileName, FileMode.Open);
Diagram vsdDiagram = new Diagram(st);

foreach (Aspose.Diagram.Page page in vsdDiagram.Pages)
{
foreach (Aspose.Diagram.Shape shape in page.Shapes)
{
foreach (Prop property in shape.Props)
{
DataRow r = dt.NewRow();
r[“Page”] = page.NameU;
r[“Shape FormulaU”] = property.Value.Ufev.F;
r[“Property Name”] = property.NameU;
r[“Shape Master”] = shape.Master.NameU.ToString();
dt.Rows.Add(r);
}

}
}
dataGridView1.DataSource = dt;
}

private void btnRead_Click(object sender, EventArgs e)
{
readfile(“visioFileBpmn.vsd”);
}
}
}


The result is in the file “ResultFormulaU.xlsx

Thaks for your help.





Hi Consu,


Thank you for sharing the sample application and test results. I have logged an investigative ticket with Id DIAGRAMNET-51146 for product team’s review. Please spare us little time to properly evaluate the case on our side, and revert back with updates in this regard.

thanks!!! I’ll wait.


Consu.

Hi Consu,


Thank you for your patience. This is to update you that we have looked further into the matter logged earlier as DIAGRAMNET-51146. Please note, when the formula is “Inh”, it means that the formula is Inherit from it’s master shape. Please try the following piece of code.

C#

Shape CFF_Cont = diagram.Pages.GetPage(“BPMN_1”).Shapes.GetShape(4);
Shape masterCff = CFF_Cont.MasterShape;
Prop masterProperty = masterCff.Props.GetProp(“BpmnElementType”);
Console.WriteLine("Name: " + masterProperty.NameU + " " + "Formula: " + masterProperty.Value.Ufev.F);

You can modify your existing logic as follow.

C#

foreach (Aspose.Diagram.Shape shape in page.Shapes)
{
foreach (Prop property in shape.Props)
{
String formula = property.Value.Ufev.F;
if (formula == "Inh")
{
formula = shape.MasterShape.Props.GetProp(property.ID).Value.Ufev.F;
}
DataRow r = dt.NewRow();
r["Page"] = page.NameU;
r["Shape FormulaU"] = formula;
r["Property Name"] = property.NameU;
r["Shape Master"] = shape.Master.NameU.ToString();
dt.Rows.Add(r);
}
}