Explorar o código

Added section "Simulating Operations With custom Java code" to user guide

Andreas Mülder %!s(int64=13) %!d(string=hai) anos
pai
achega
466eee8ad9

+ 1 - 0
plugins/org.yakindu.sct.doc.user/help/03_Tasks/tasks-toc.xml

@@ -1,6 +1,7 @@
 <?xml version='1.0' encoding='utf-8' ?>
 <?xml version='1.0' encoding='utf-8' ?>
 <toc topic="help/03_Tasks/tasks.html" label="tasks">
 <toc topic="help/03_Tasks/tasks.html" label="tasks">
 	<topic href="help/03_Tasks/tasks.html" label="Tasks">
 	<topic href="help/03_Tasks/tasks.html" label="Tasks">
+		<topic href="help/03_Tasks/tasks.html#SimulatingOperationsWithCustomJavaCode" label="Simulating Operations With Custom Java Code"></topic>
 		<topic href="help/03_Tasks/tasks.html#GeneratingCode" label="Generating Code"></topic>
 		<topic href="help/03_Tasks/tasks.html#GeneratingCode" label="Generating Code"></topic>
 	</topic>
 	</topic>
 </toc>
 </toc>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 7 - 1
plugins/org.yakindu.sct.doc.user/help/03_Tasks/tasks.html


+ 26 - 0
plugins/org.yakindu.sct.doc.user/help/03_Tasks/tasks.textile

@@ -3,6 +3,32 @@
 
 
 h1. Tasks
 h1. Tasks
 
 
+h2. Simulating Operations With Custom Java Code
+
+To simulate a model with operations it is possible to use custom Java code that mocks the desired behavior or even to simulate against an existing java backend. 
+For that to work, it is required to provide one or more custom java classes having a method with a matching signature. 
+
+
+!images/operationsExample.png!
+
+To simulate the statechart above, a new Java Class must be created matching the method signature defined in the statechart. This class must be placed onto the classpath of the
+statecharts project.  
+ 
+bc. 
+package example;
+public class Calculator {
+   public int add(int param1, int param2) {
+      return param1 + param2;
+   }
+}
+
+This custom class can be passed to the run configuration as *Operation Class*, shown in the figure below. It is possible to pass multiple java classes seperated by a comma.
+If the simulation is executed, the variable result gets the value 2.
+
+!images/runConfiguration.png!
+
+
+
 h2. Generating Code
 h2. Generating Code
 
 
 For configuring the code generation process, YAKINDU Statechart Tools uses a textual generator model called *SGen*. It can be created either by using the provided wizard *Yakindu Statechart Generator Model* or by creating a new text file with the file extension '.sgen'.
 For configuring the code generation process, YAKINDU Statechart Tools uses a textual generator model called *SGen*. It can be created either by using the provided wizard *Yakindu Statechart Generator Model* or by creating a new text file with the file extension '.sgen'.