Skip to content

Commit

Permalink
Processors work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
pvlasov committed Mar 9, 2024
1 parent 28c97b3 commit 611404b
Show file tree
Hide file tree
Showing 21 changed files with 550 additions and 40 deletions.
2 changes: 0 additions & 2 deletions model/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
1 change: 1 addition & 0 deletions model/model/function-flow.ecore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="implementation" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="errors" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="configuration" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Start" eSuperTypes="../../org.nasdanika.models.architecture/model/architecture.ecore#//RelationshipSource">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="condition" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
Expand Down
1 change: 1 addition & 0 deletions model/model/function-flow.genmodel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<genClasses ecoreClass="function-flow.ecore#//FlowElement">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute function-flow.ecore#//FlowElement/implementation"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute function-flow.ecore#//FlowElement/errors"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute function-flow.ecore#//FlowElement/configuration"/>
</genClasses>
<genClasses ecoreClass="function-flow.ecore#//Start">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute function-flow.ecore#//Start/condition"/>
Expand Down
24 changes: 24 additions & 0 deletions model/src/main/java/org/nasdanika/models/functionflow/Flow.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,29 @@
*/
package org.nasdanika.models.functionflow;

import java.util.Collections;
import java.util.Map;
import java.util.Map.Entry;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;

import org.eclipse.emf.ecore.EObject;
import org.nasdanika.common.Context;
import org.nasdanika.common.ProgressMonitor;
import org.nasdanika.common.Transformer;
import org.nasdanika.graph.model.adapters.ConnectionAdapter;
import org.nasdanika.graph.model.adapters.ElementAdapter;
import org.nasdanika.graph.model.adapters.GraphAdapterFactory;
import org.nasdanika.graph.model.adapters.NodeAdapter;
import org.nasdanika.graph.model.util.ReflectiveProcessorFactory;
import org.nasdanika.graph.processor.NopEndpointProcessorConfigFactory;
import org.nasdanika.graph.processor.ProcessorConfig;
import org.nasdanika.graph.processor.ProcessorInfo;
import org.nasdanika.graph.processor.function.BiFunctionProcessorFactory;
import org.nasdanika.graph.processor.function.ReflectiveBiFunctionProcessorFactoryProvider;
import org.nasdanika.models.architecture.Domain;
import org.nasdanika.ncore.NamedElement;

/**
* <!-- begin-user-doc -->
Expand All @@ -15,4 +37,6 @@
* @generated
*/
public interface Flow extends FlowElement, Domain {


} // Flow
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* <ul>
* <li>{@link org.nasdanika.models.functionflow.FlowElement#getImplementation <em>Implementation</em>}</li>
* <li>{@link org.nasdanika.models.functionflow.FlowElement#getErrors <em>Errors</em>}</li>
* <li>{@link org.nasdanika.models.functionflow.FlowElement#getConfiguration <em>Configuration</em>}</li>
* </ul>
*
* @see org.nasdanika.models.functionflow.FunctionFlowPackage#getFlowElement()
Expand Down Expand Up @@ -57,4 +58,26 @@ public interface FlowElement extends ArchitectureDescriptionElement {
*/
EList<String> getErrors();

/**
* Returns the value of the '<em><b>Configuration</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Configuration</em>' attribute.
* @see #setConfiguration(String)
* @see org.nasdanika.models.functionflow.FunctionFlowPackage#getFlowElement_Configuration()
* @model
* @generated
*/
String getConfiguration();

/**
* Sets the value of the '{@link org.nasdanika.models.functionflow.FlowElement#getConfiguration <em>Configuration</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Configuration</em>' attribute.
* @see #getConfiguration()
* @generated
*/
void setConfiguration(String value);

} // FlowElement
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
*/
package org.nasdanika.models.functionflow;

import java.util.function.BiFunction;

import org.nasdanika.common.Context;
import org.nasdanika.common.ProgressMonitor;
import org.nasdanika.graph.processor.ProcessorInfo;
import org.nasdanika.models.architecture.CompositeNode;


Expand All @@ -16,4 +21,22 @@
* @generated
*/
public interface FunctionFlow extends Function, CompositeNode, SupplierFlow, ConsumerFlow {

/**
* Creates a process, wires endFunction to ends, and returns function wired to starts.
* @param endFunction
* @param context
* @param progressMonitor
* @return
*/
default BiFunction<Object, ProgressMonitor, Object> createProcessor(
BiFunction<Object, ProgressMonitor, Object> endFunction,
Context context,
ProgressMonitor progressMonitor) {

ProcessorInfo<BiFunction<Object, ProgressMonitor, Object>> processorInfo = createProcessor(context, progressMonitor);
// TODO - wire ends to the end function, return a function wired to starts.
throw new UnsupportedOperationException();
}

} // FunctionFlow
Loading

0 comments on commit 611404b

Please sign in to comment.