Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Geert Bellekens

Pages: 1 ... 3 4 [5] 6 7 ... 818
61
This is the script (VBScript) I use.
The connectionstring is copied from an encrypted EA shortcut file.
This fully automatically transfers our projects from SQL Server to .eap files.

Code: [Select]
const logPath =    "G:\Projects\80 Enterprise Architect\Output\Backups\LogFile\"
const backupPath = "G:\Projects\80 Enterprise Architect\Output\Backups\"

'---------------------------CONFIGURATION---------------------------------------
const EADEVconnectionString = "DBType=1;ConnectEx=6' lgOUNphsdL9V'v^;KJl*`XYta*2{S3%Qoj=E*7%u&LT# R7w(E9p%?Yajszqn#87d3Q$+NX3Gn<SdG!W|^)AJ[XQ!Z{mY""muLhLVnIW'Q6t,3Sq4'(fA6-GI|GK1DY8[iwAvtW2I3XZ:ydO`97W70[m2ieu=l@+*7{=HsGsqdw=^aFD)Wy-^3{;cfgVxov2az:7mC0T5^<IR""=:<<<!$Ke10\fzF^*:iJ-R,U?ct^i; V9_fpj5,maX64Xb\_]1TfQIX{n()$jv\2@`g'ndbnK8%FCWW)#vEEj`"
'---------------------------CONFIGURATION---------------------------------------


sub main
dim repository
set repository = CreateObject("EA.Repository")
'backup DEV
backupRepository repository, EADEVconnectionString, backupPath, logPath, "EA DEV"
'close EA
repository.Exit
'tell user we have finished
msgbox "Finished backups"
end sub


function backupRepository (repository, sourceModel, backupPath, logPath, modelName)
Dim currentDate
currentdate = (Year(Date) & (Right(String(2,"0") & Month(Date), 2)) & (Right(String(2,"0") & Day(Date), 2)))  'yyyymmdd'

dim projectInterface
 
dim logFilePath
logFilePath = logPath & CurrentDate & " " & modelName & " (back-up).log"

'delete logfile if exists
deleteFile logFilePath

dim targetFilePath
targetFilePath = backupPath & CurrentDate & " " & modelName & " (back-up).eap"

'delete targetfile if exists
deleteFile targetFilePath

'get project interface
set projectInterface = repository.GetProjectInterface()
'execute project transfer
projectInterface.ProjectTransfer sourceModel, targetFilePath, logFilePath

end function

function deleteFile (filePath)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.FileExists(filePath) then
fso.DeleteFile filePath
end if
end function

main

I'll try to adapt this to check if it also works to transfer from .eap to .qea

Geert

62
General Board / Re: What happened to announcing releases?
« on: January 19, 2023, 04:30:26 pm »

63
General Board / What happened to announcing releases?
« on: January 19, 2023, 02:01:15 am »
The last two releases (16.1.1622 and 16.1.1623) have not been announced on the Latest News board: https://sparxsystems.com/forums/smf/index.php/board,22.0.html

@Sparks, did you forget, or is there a new communication strategy for releases?

Geert

64
I'll have a look with the newest version, but I use this function on older versions since years.
It always worked perfectly fine without any dialogs showing.
In our code, we first delete the log file as well.

It might be a bug though.

Have you tried by passing literal strings to the function?

Geert

65
Yes, it's possible but the target file should not exist yet.

That's different from the GUI, where the target file should exist.

Geert

66
Try passing a type as second parameter to the AddNew operation. An empty string is not a valid type.

Geert

67
You can bet on that xD

q.

P.S. When you issue a query the Weight actually is shown as a Real number. The example model has a few with weight 1.00 but most being 0.00
Ah, I can now think of a scenario where that might have gone wrong.

- Get the weight value as string "1.00"
- Try to store the same value as Real, messing up the decimal point/comma notation, and end up storing the value 100 instead.
- Get the weight value as string "100.00"
- Try to store the same value as Real, messing up the decimal point/comma notation, and end up storing the value 10000 instead.
- Rinse and repeat

And that indeed checks out with the actual values found. Most of them are round numbers like 5000000000 or 2000000

Geert

68
Did the addNew operation fail for some reason? (because you passed an empty string as the type)

It might have failed silently. IIRC there is a getlatestError thing somewhere in like Repository. It might help, but I'm not sure.

Geert

69
Bugs and Issues / Re: Mini diagram images in generated documents
« on: January 18, 2023, 09:40:45 pm »
I'm not seeing that. I have a bunch of other issues with document generation, but not that.

Geert

70
Well, at least one additional info. The current statement about weight in my Inside is "does not seem to be mapped in the GUI".

q.
Yeah, you could change that into "is named wrong and should really be named pos to be consistent with t_attribute etc..."

Geert

71
General Board / Re: Automatically change 'Status' to "proposed' on change
« on: January 18, 2023, 08:37:04 pm »
That's correct there is no "out-of-the-box" solution.

To supplement what Geert as an alternative to an add-in which requires an installer you could have a look at Model Add-ins.

I have successfully used these to respond to EA_OnContextItemModified to monitor / update element properties.

Phil
Hi Phil,

Model-addins was actually my first suggestion :)

Geert

72
General Board / Re: Automatically change 'Status' to "proposed' on change
« on: January 18, 2023, 07:58:51 pm »
Yes, but you'll need to write some add-in that runs in the EA_OnContextItemModified

Options are:
- Use a Model Addin: https://sparxsystems.com/enterprise_architect_user_guide/16.1/add-ins___scripting/modeladdins.html
- Write an EA-Matic script: https://bellekens.com/ea-matic/
- Write a full blown add-in

I would use an EA-Matic script (but I guess I'm a bit biased)

Geert

73
Hi Geert,
Might it have something to do with the difference between BPMN 1.x and BPMN 2.0?  I think BPMN 1 defines the Action and BPMN 2 defines a Call Activity, but I'm no expert.

Paolo
Thanks Paolo,

No, in both cases it's BPMN 2.0

Geert

74
Will the consitency check repair them?

q.
No, I run those regularly, and they haven't touched the weight values.

Geert

75
General Board / Re: Changing the Icon of an element in Project Browser
« on: January 18, 2023, 03:17:16 am »
If you set the icon on the stereotype, it will show in both the toolbox as the project browser.

Geert

Pages: 1 ... 3 4 [5] 6 7 ... 818