From 1ae289f0f5e61156df3e29cd7a078c3b601b7b69 Mon Sep 17 00:00:00 2001
From: Alberto Debiasi <adebiasi@fbk.eu>
Date: Fri, 30 Nov 2018 08:54:14 +0100
Subject: [PATCH] fixed bug on command dialogs

Change-Id: I1d5de2fecea04449f4d31931fbce0e52ea3c9720
---
 ...eckValidationAssertionPropertyCommand.java | 15 +++++++------
 ...heckValidationContractPropertyCommand.java | 17 ++++++++-------
 .../ui/commands/ModelCheckingCommand.java     | 21 +++++++++++--------
 3 files changed, 31 insertions(+), 22 deletions(-)

diff --git a/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/CheckValidationAssertionPropertyCommand.java b/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/CheckValidationAssertionPropertyCommand.java
index 78b81c2ed..8dd679444 100644
--- a/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/CheckValidationAssertionPropertyCommand.java
+++ b/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/CheckValidationAssertionPropertyCommand.java
@@ -115,12 +115,7 @@ public class CheckValidationAssertionPropertyCommand extends AbstractJobCommand
 
 	@Override
 	public void execJobCommand(ExecutionEvent event, IProgressMonitor monitor) throws Exception {
-		String[] expression = new String[1]; // It will be filled by the method
-		commandExecuted = ocraExecService.executeValidationAssertionProperty(umlSelectedComponent, selectedInstantiatedArchitectureConfiguration,umlSelectedResource,
-				isDiscreteTime, usexTextValidation, showPopups, ossFilepath, resultFilePath, monitor, true, expression,contextList);
-		if(commandExecuted){
-			conditions = createConditions(expression[0].split("#"));
-			}
+		
 		
 	}
 
@@ -154,6 +149,14 @@ public class CheckValidationAssertionPropertyCommand extends AbstractJobCommand
 
 	@Override
 	public void execPostJobOperations(ExecutionEvent event, NullProgressMonitor nullProgressMonitor) throws Exception {
+		
+		String[] expression = new String[1]; // It will be filled by the method
+		commandExecuted = ocraExecService.executeValidationAssertionProperty(umlSelectedComponent, selectedInstantiatedArchitectureConfiguration,umlSelectedResource,
+				isDiscreteTime, usexTextValidation, showPopups, ossFilepath, resultFilePath, nullProgressMonitor, true, expression,contextList);
+		if(commandExecuted){
+			conditions = createConditions(expression[0].split("#"));
+			}
+		
 		if (commandExecuted) {
 
 			// Store the result
diff --git a/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/CheckValidationContractPropertyCommand.java b/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/CheckValidationContractPropertyCommand.java
index e5c124253..5883db63e 100644
--- a/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/CheckValidationContractPropertyCommand.java
+++ b/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/CheckValidationContractPropertyCommand.java
@@ -112,12 +112,7 @@ public class CheckValidationContractPropertyCommand extends AbstractJobCommand {
 
 	@Override
 	public void execJobCommand(ExecutionEvent event, IProgressMonitor monitor) throws Exception {
-		String[] expression = new String[1]; // It will be filled by the method
-		commandExecuted = ocraExecService.executeValidationContractProperty(umlSelectedComponent, selectedInstantiatedArchitectureConfiguration, umlSelectedResource,
-				isDiscreteTime, usexTextValidation, showPopups, ossFilepath, resultFilePath, monitor, true, expression,contextList);
-		if(commandExecuted){
-		conditions = createConditions(expression[0].split("#"));
-		}
+		
 	}
 
 	private EList<String> createConditions(String[] expression) {
@@ -145,7 +140,15 @@ public class CheckValidationContractPropertyCommand extends AbstractJobCommand {
 	}
 
 	@Override
-	public void execPostJobOperations(ExecutionEvent event, NullProgressMonitor nullProgressMonitor) throws Exception {
+	public void execPostJobOperations(ExecutionEvent event, NullProgressMonitor monitor) throws Exception {
+		
+		String[] expression = new String[1]; // It will be filled by the method
+		commandExecuted = ocraExecService.executeValidationContractProperty(umlSelectedComponent, selectedInstantiatedArchitectureConfiguration, umlSelectedResource,
+				isDiscreteTime, usexTextValidation, showPopups, ossFilepath, resultFilePath, monitor, true, expression,contextList);
+		if(commandExecuted){
+		conditions = createConditions(expression[0].split("#"));
+		}
+		
 		if (commandExecuted) {
 
 			// Store the result
diff --git a/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/ModelCheckingCommand.java b/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/ModelCheckingCommand.java
index 000275305..236e0b4a2 100644
--- a/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/ModelCheckingCommand.java
+++ b/plugins/contracts/org.polarsys.chess.contracts.verificationService/src/org/polarsys/chess/verificationService/ui/commands/ModelCheckingCommand.java
@@ -87,6 +87,8 @@ public class ModelCheckingCommand extends AbstractJobCommand {
 	private boolean commandExecuted;
 	private EList<String> conditions;
 	private List<AnalysisContextElement> contextList;
+	 String generatedSmvFilePath;
+	 boolean internalExecution = true;
 	
 	@Override
 	public void execPreJobOperations(ExecutionEvent event, IProgressMonitor monitor) throws Exception {
@@ -144,8 +146,7 @@ public class ModelCheckingCommand extends AbstractJobCommand {
 	public void execJobCommand(ExecutionEvent event, IProgressMonitor monitor) throws Exception {
 		if (!isProgrExec) {
 
-			final String generatedSmvFilePath;
-			final boolean internalExecution = true;
+		
 
 			if (isLeafComponent(umlSelectedComponent)) {
 				generatedSmvFilePath = smvExportService.exportSingleSmv(umlSelectedComponent, showPopups,
@@ -163,13 +164,7 @@ public class ModelCheckingCommand extends AbstractJobCommand {
 				logger.debug("createMonolithicSMV done");
 			}
 
-			// Compose the conditions
-			String[] expression = new String[1]; // It will be filled by the
-													// method
-			commandExecuted = nuXmvExecService.executeModelChecking(generatedSmvFilePath, resultFilePath,
-					event.getParameter("algorithm_type"), event.getParameter("check_type"),
-					event.getParameter("property"), isProgrExec, internalExecution, expression,contextList);
-			conditions = createConditions(expression[0].split("#"));
+			
 		}
 
 	}
@@ -194,6 +189,14 @@ public class ModelCheckingCommand extends AbstractJobCommand {
 
 	@Override
 	public void execPostJobOperations(ExecutionEvent event, NullProgressMonitor nullProgressMonitor) throws Exception {
+		
+		// Compose the conditions
+					String[] expression = new String[1]; // It will be filled by the
+															// method
+					commandExecuted = nuXmvExecService.executeModelChecking(generatedSmvFilePath, resultFilePath,
+							event.getParameter("algorithm_type"), event.getParameter("check_type"),
+							event.getParameter("property"), isProgrExec, internalExecution, expression,contextList);
+					conditions = createConditions(expression[0].split("#"));
 		// If requested to store the data, execute the command here, cannot be
 		// called later
 		if (commandExecuted) {
-- 
GitLab