Skip to content

Commit 2ac893f

Browse files
laszloItemispaphko
andauthored
CREATE integration for code generation and state machine validation (#6)
* Add example state machine. * Updated target, added Create dependency * Updgrade to JavaSE21, impl CREATE codegen integration * added codegen, updated pom, added updated example model for codegen * Validation for Statecharts * Add new faults state machine with issues. * Fix json content, add launch config for sct validation, update launches * Test and necessary modifications * Use default domain for Java codegen * AddIn extension for code generation * Add progress bar for codegen, disable buttons, fix csharp * Replace xtend-files with java-files and remove xtend dependency. * Rebranding of the CLI * update POM-less build config: use tycho version 4.0.13. * Update readme. --------- Co-authored-by: Patrick Koenemann <koenemann@itemis.de>
1 parent f12b79e commit 2ac893f

96 files changed

Lines changed: 4046 additions & 955 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33

4+
## Ignore Mac Explorer garbage
5+
.DS_Store
6+
47
# User-specific files
58
*.suo
69
*.user

AddIn/EABridge_Example_AddIn_Setup/AddInDependency.generated.wxs

Lines changed: 0 additions & 13 deletions
This file was deleted.

AddIn/EABridge_Example_AddIn_Setup/EABridge_Example_AddIn_Setup.wixproj

Lines changed: 0 additions & 74 deletions
This file was deleted.

AddIn/EABridge_Example_AddIn_Setup/Product.wxs

Lines changed: 0 additions & 58 deletions
This file was deleted.

AddIn/EABridge_Example_AddIn_Setup/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

AddIn/EABridge_Example_AddIn_Tests/EABridge_Example_AddIn_Tests.csproj

Lines changed: 0 additions & 31 deletions
This file was deleted.

AddIn/EABridge_Example_AddIn.sln renamed to AddIn/Itemis_Integrate_EA_Example_AddIn.sln

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.1.32328.378
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EABridge_Example_AddIn", "EABridge_Example_AddIn\EABridge_Example_AddIn.csproj", "{9865ECCC-F07B-447A-BD11-C75B081EEBA4}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Itemis_Integrate_EA_Example_AddIn", "Itemis_Integrate_EA_Example_AddIn\Itemis_Integrate_EA_Example_AddIn.csproj", "{9865ECCC-F07B-447A-BD11-C75B081EEBA4}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EABridge_Example_AddIn_Tests", "EABridge_Example_AddIn_Tests\EABridge_Example_AddIn_Tests.csproj", "{7B90E5BE-58B0-4326-BD48-815220DC0D3B}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Itemis_Integrate_EA_Example_AddIn_Tests", "Itemis_Integrate_EA_Example_AddIn_Tests\Itemis_Integrate_EA_Example_AddIn_Tests.csproj", "{7B90E5BE-58B0-4326-BD48-815220DC0D3B}"
99
EndProject
10-
Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "EABridge_Example_AddIn_Setup", "EABridge_Example_AddIn_Setup\EABridge_Example_AddIn_Setup.wixproj", "{788CC963-0BEA-4CC6-826C-589AEA2AD2DB}"
10+
Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "Itemis_Integrate_EA_Example_AddIn_Setup", "Itemis_Integrate_EA_Example_AddIn_Setup\Itemis_Integrate_EA_Example_AddIn_Setup.wixproj", "{788CC963-0BEA-4CC6-826C-589AEA2AD2DB}"
1111
EndProject
1212
Global
1313
GlobalSection(SolutionConfigurationPlatforms) = preSolution

AddIn/EABridge_Example_AddIn/ApplicationHandlers/ExampleHeadlessApplicationHandler.cs renamed to AddIn/Itemis_Integrate_EA_Example_AddIn/ApplicationHandlers/ExampleHeadlessApplicationHandler.cs

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using EABridge_Example_AddIn.Utils;
1+
using ItemisIntegrateEA_Example_AddIn.Utils;
22
using System;
33
using System.Diagnostics;
44
using System.IO;
55
using System.Threading;
66

7-
namespace EABridge_Example_AddIn.ApplicationHandlers
7+
namespace ItemisIntegrateEA_Example_AddIn.ApplicationHandlers
88
{
99
public class ExampleHeadlessApplicationHandler
1010
{
@@ -23,6 +23,35 @@ public bool IsThreadRunning()
2323
return thread != null;
2424
}
2525

26+
public void StartExternGenerationOperationAsync(string guid, string modelPath, string outputPath, string language)
27+
{
28+
string[] arguments = ComputeGenerationArguments(guid, modelPath, outputPath, language);
29+
StartExternApplicationAsync(arguments, null);
30+
}
31+
32+
private string[] ComputeGenerationArguments(string guid, string modelPath, string outputPath, string language)
33+
{
34+
string[] arguments = new string[6];
35+
36+
arguments[0] = "codegen";
37+
arguments[1] = @"""" + language + @""""; // target language
38+
arguments[2] = @"""" + modelPath + @""""; // input model path
39+
arguments[3] = @"""" + outputPath + @""""; // target folder
40+
arguments[4] = @"""" + guid + @""""; // EA element GUID
41+
arguments[5] = "-v"; // verbose flag
42+
43+
string executablePath = HeadlessApplicationUtils.FindExecutable();
44+
45+
if (!File.Exists(executablePath))
46+
{
47+
Debug.WriteLine("Error: " + executablePath + " not found.");
48+
throw new FileNotFoundException("Error: " + executablePath + " not found.");
49+
}
50+
51+
return arguments;
52+
}
53+
54+
2655
public void StartExternValidationOperationAsync(string guid, string path)
2756
{
2857
string reportFile = ExampleHeadlessApplicationHandler.GetReportFilePath();
@@ -114,7 +143,10 @@ private void StartExternApplication(string arguments,
114143

115144

116145
ExternApplicationEventArgs eventArgs = new ExternApplicationEventArgs();
117-
eventArgs.ReportFile = reportFile;
146+
if(reportFile != null)
147+
{
148+
eventArgs.ReportFile = reportFile;
149+
}
118150
eventArgs.ReturnCode = p.ExitCode;
119151
eventArgs.Duration = DateTimeUtils.GetTimeDifferenceInMilisec(startTime, endTime);
120152

0 commit comments

Comments
 (0)