News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

VisioDB Project - Visio Database Project Releases

Started by maclarkson, September 19, 2019, 12:14:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

maclarkson

Hay Yasin, I am trying to achieve the same as you. I am an enterprise architect and part of what I am trying to do must include infrastructure. This stage I would like to accomplish synchronisation with connected objects using connector. If we can achieve this we only have to extend the same functionality to embedded objects. When I am doing a function decomposition, or an infrastructure decomposition I will need the ability to synchronise the decomposition as connected objects. Or have to index and query all of the objects to mine for the data.

If we can achieve these things it should be just a matter of creating new objects and using the same function to collect the data.

maclarkson

QuoteIt is important to decide who is the data master, the drawing or the the DB. They can't both be the master. In my projects its generally the drawing. Even data not related directly to drawing issues should be saved in the vsd* . This way the DB becomes a simple control tool, not the recipient of the data. This is in so far important as you can replace the DB (the control tool) and continue working on existing documents.
Creating shapes from rows in the DB is interesting but requires to have certain questions solved beforehand:
Where and how to place the shapes
Have a stencils management system and a configuration tool for masters. This includes also the management of the custom properties

I need to be able to do it both ways. Imagine you are in a meeting and someone begins to discuss a number of changes or new configurations. You should be able to go onto your mobile and add the connections then later come back and diagram the changes.

Yacine

There's nothing wrong with implementing an import function for updating the data, but still a master needs to be defined.
There may be cases where the data are split between the drawing and the DB - each category being stored in the other document.
Yacine

wapperdude

...and there's the issue when two or more people are working on same drawing.

This strikes me as a major effort.  A lot to ask and expect of volunteers.  Especially the coding part.
Visio 2019 Pro

Yacine

Quote from: wapperdude on September 24, 2019, 12:54:54 PM
...and there's the issue when two or more people are working on same drawing.

This strikes me as a major effort.  A lot to ask and expect of volunteers.  Especially the coding part.

That's why I'm recommending an "import" function instead of an automatic update. This way it a conscious decision to overwrite the data in the master document. Much easier than a version management system.
Yacine

cliff50

I sense "rate of change" of subject data may also be important.

From my experience, I am familiar with this type of modelling deployment. I used "model locking" as opposed to "record locking" to minimize  data conflicts.

The model consists of (4 x files)> ( VSD /  DB files plus KeyLock text file plus DateTime textfile.) are located on a central server. When a change to the model is required:

The operator uses a coded script to download from the central server the VSD and the DB files.

1.The scripting routines firsts checks if the KeyLock file is "LOCKED" or "UNLOCKED"... if it is "LOCKED" it means the model is being edited by another user  and will not allow any upload from the local user toward the central server. .... if unlocked, it will download the VSD/DB files regardless, providing that the datetime version of the local model is older than the server model.

Now. If the operator wishes to EDIT the model  ...  scripting routine will download the latest  (DateTime dependent), (Unlocked) version of model from central server and change the Keylock text  file on central server file to LOCKED position.

After Changes are made , the operator uses a scripting routine to upload the VSD/DB files to the central server and set the KeyLock text file to "UNLOCKED". and set the DateTime file to current date time.

Assumptions:
speed of upload/download is dependent on file sizes and link speed <central server> to <local machine>.
Rate of data change is presumed low however, it is directly proportional to number of Editors.

The above method describes how model Editors ""contend"" for the right to edit the ""leading edge version"" of the model.



Nikolay

#21
Quote from: maclarkson on September 23, 2019, 12:04:54 PM
I have attached my first effort I used the database link to access the database and then used NiKolay's back sync to sync data back. issues are that the experience is a pretty ugle one.

1) you can create new objects and have them be created in your database so you have to create your objects in the database first
2) the shape data governed from the database does not have drop-down values that are the same as those in the database. The only way id be able to get the list values would be to create a data set and then i'd have to populate by hand all of the drop-down values.

Of course, the experience would be pretty ugly :D
When you connect to a data source, Visio has no idea that some fields are backed by dictionaries in the database (like your"Object Type"). So it generates default (string) fields. Therefore you don't get any dropdowns. In principle, generating such dropdowns is possible, but you don't get that "for free" with Visio. Since Visio is thought to be data *visualization* tool (i.e. you visualize your database content in Visio, not enter the data)

People who need to enter data, usually build their own (VBA?) forms, or design shapes to have those dropdowns..

You could also use SharePoint as a backing repository. So that it is all online in one place with basics (document storage, co-authoring, reviews, version history) set up. No need for home-grown document locking. You could enter data in a form with dropdowns (if you link shape to a SharePoint list item). You can even edit layout online now. Isn't it an option? From access database you can go there directly, there is a button "export database to SharePoint"

maclarkson

Nikolay:
I should be able to populate the files without code. I simply create a field in the database to concatenate the drop downs and add them to every object. Then when the object syncs I can use the actions in the shape sheet to update the format fields in the shape sheet.

In the meantime I cannot use lists in SharePoint as there is no way to have a many to many relationship between tables. Plus the app capability of SharePoint is crap.

I would like to build the forms using the software development kit but my knowledge of vba is slim. I was hoping with the right guidance from you guys you could help me make something. I am sure every person who uses Visio wishes they could do the things that this tool could achieve.

Yasine
I Agree that import export should be done manually. At this stage I will manage data integrity via reporting. All I need at this point is an MVP.

The source has to be the database because I will most definitely need to use objects multiple times.

cliff50

#23
If you want,

attached vsd file is a rough shell of test solution.

I use visio pro 2016 (64 bit) . I use DB.accdb (64 bit) so I hope it works on your machine.

Position Test VSD and DB.accdb files in same folder//  enable macros when you initiate Test.vsd// ensure the necessary references are checked in vsd coding environment.// open ADDIN tag and you should see extra customized buttons// explore Test button it may give you ideas  how to open form in Visio to code query s on database and bring results back into Visio.  This shows only a select query... append delete update etc are coded slightly different.

HTH
Cliff

maclarkson

hay cliff,

Could you tell me step by step what I need to do to test your thingy out?

maclarkson

Actually I got it to work, yay, that will definitely be useful

maclarkson

I was looking at the code and I could not identify where there commandButton1 executes that request to the database?

cliff50

if you are looking at the code ..

Private Sub CommandButton1_Click()
Test  ''' <<<<<<<<   this is a call to the function called test
End Sub



Public Function Test() <<< here is the function test
Dim myarray As Variant
Dim db As Database
Dim rstsource As Recordset
Dim num, R As Integer


'' target the database
Set db = DBEngine.OpenDatabase(ThisDocument.path & "DB.accdb") 'Identify the Database

Set rstsource = db.OpenRecordset("SELECT Data.Forename, Data.Lastname, Data.ShapeID " & _  ''pull the selected data into a record set
"FROM Data;")

num = EnumerateSet(rstsource)  'determines how many entries in the recordset

ReDim myarray(num, 3) '' 6) ''set the dimensions of the array
R = 1


  '' iterate through the recordset transfering the contents into array

If rstsource.RecordCount > 0 Then
        With rstsource
       
        ' load array with Recordset.
        .MoveFirst
         Do While Not .EOF

         myarray(R, 0) = !Forename
         myarray(R, 1) = !lastname
         myarray(R, 2) = !ShapeID
         
            R = R + 1
           
          .MoveNext
        Loop
        End With
End If

frmTest.ListBox1.ColumnWidths = "42.5 pt;42.5 pt;42.5 pt;"

frmTest.ListBox1.List = myarray  ''<<<<<<<<  load the listbox with the contents of the array

End Function


cliff50

some of the code is in the form >> frmTest

right click -> view code

Nikolay

#29
Quote from: maclarkson on September 25, 2019, 02:23:03 PM
In the meantime I cannot use lists in SharePoint as there is no way to have a many to many relationship between tables.

But how is it different from Access database? Couldn't you create the same "joining" many-to-many "connector" table (well, "list" in terms of SharePoint)

Quote
Plus the app capability of SharePoint is crap.

Does not compute :) Could you clarify?
I was under impression that app capability of SharePoint is amazing, especially with "modern" pages and apps?

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 401 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1280KB.
Tokens: post-login.
Cache hits: 13: 0.00147s for 26,729 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]