Skip to content

Commit 03492d3

Browse files
Merge pull request #6 from aljoshakoecher/prepare-for-release
Prepare for release
2 parents d6d91b0 + 874b0ed commit 03492d3

7 files changed

Lines changed: 175 additions & 52 deletions

File tree

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,33 @@ Work in progress, coming soon
8181

8282

8383
## Usage
84-
It's very easy to use this library in your own projects. If you're working with Maven, simply add this dependency to the `<dependencies>` in you pom.xml.
84+
With Maven, it's very easy to use this library in your own projects. Releases are published to the Maven Central Repo, snapshot version can be obtained from Sonatype.
85+
86+
### Releases
87+
Releases can be found on the Maven Central repository. Just add this dependency to your pom.xml:
8588

8689
```xml
8790
<dependency>
88-
<groupId>de.hsu-hh.aut</groupId>
91+
<groupId>com.github.aljoshakoecher</groupId>
8992
<artifactId>isa88-state-machine</artifactId>
9093
<version>1.0.0</version>
9194
</dependency>
9295
```
9396

94-
### Releases
95-
I'm currently working on publishing releases to the Sonatype Maven repo. Coming soon..
97+
### Snapshots
98+
Make sure to add the Sonatype repo to your POM if you want to grab a snapshot version:
99+
100+
```
101+
<repository>
102+
<id>oss-sonatype</id>
103+
<name>oss-sonatype</name>
104+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
105+
</repository>
106+
```
96107

97108
### Building from source
98-
This project is built with Maven. You can simply build this library from source if you have Maven installed. Simply clone or download this repository and run
99-
run `mvn clean install` from the project root.
109+
This project is built with Maven. You can simply build this library from source if you have Maven installed. Clone or download this repository and run
110+
`mvn clean install` from the project root.
100111

101112
## Disclaimer
102113
Please note that the figure above and all definitions of states and transitions have been taken from the [OMAC PackML Implementation Guide](http://omac.org/wp-content/uploads/2016/11/PackML_Unit_Machine_Implementation_Guide-V1-00.pdf) for ISA 88.

pom.xml

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,51 @@
22
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
5-
<groupId>de.hsu-hh.aut</groupId>
5+
<groupId>com.github.aljoshakoecher</groupId>
66
<artifactId>isa88-state-machine</artifactId>
77
<version>1.0.0</version>
8+
<packaging>jar</packaging>
9+
810
<name>ISA 88 State Machine</name>
911
<description>State Machine according to ISA 88 that can be used to quickly implement a behavior that is consistent with ISA 88</description>
12+
<url>https://github.com/aljoshakoecher/ISA88-StateMachine</url>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
</properties>
17+
18+
<developers>
19+
<developer>
20+
<name>Aljosha Koecher</name>
21+
<email>aljosha.koecher@hsu-hh.de</email>
22+
<organization>Helmut-Schmidt-University, Institute of Automation</organization>
23+
<organizationUrl>http://www.hsu-hh.de/aut</organizationUrl>
24+
</developer>
25+
</developers>
26+
27+
<licenses>
28+
<license>
29+
<name>MIT License</name>
30+
<url>http://www.opensource.org/licenses/mit-license.php</url>
31+
</license>
32+
</licenses>
33+
34+
<distributionManagement>
35+
<snapshotRepository>
36+
<id>ossrh</id>
37+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
38+
</snapshotRepository>
39+
<repository>
40+
<id>ossrh</id>
41+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
42+
</repository>
43+
</distributionManagement>
44+
45+
<scm>
46+
<connection>scm:git:git://github.com/aljoshakoecher/ISA88-StateMachine</connection>
47+
<developerConnection>scm:git:ssh://github.com/aljoshakoecher/ISA88-StateMachine</developerConnection>
48+
<url>https://github.com/aljoshakoecher/ISA88-StateMachine</url>
49+
</scm>
1050

1151
<build>
1252
<plugins>
@@ -35,6 +75,57 @@
3575
</dependency>
3676
</dependencies>
3777
</plugin>
78+
<plugin>
79+
<groupId>org.sonatype.plugins</groupId>
80+
<artifactId>nexus-staging-maven-plugin</artifactId>
81+
<version>1.6.7</version>
82+
<extensions>true</extensions>
83+
<configuration>
84+
<serverId>ossrh</serverId>
85+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
86+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
87+
</configuration>
88+
</plugin>
89+
<plugin>
90+
<groupId>org.apache.maven.plugins</groupId>
91+
<artifactId>maven-source-plugin</artifactId>
92+
<version>2.2.1</version>
93+
<executions>
94+
<execution>
95+
<id>attach-sources</id>
96+
<goals>
97+
<goal>jar-no-fork</goal>
98+
</goals>
99+
</execution>
100+
</executions>
101+
</plugin>
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-javadoc-plugin</artifactId>
105+
<version>2.9.1</version>
106+
<executions>
107+
<execution>
108+
<id>attach-javadocs</id>
109+
<goals>
110+
<goal>jar</goal>
111+
</goals>
112+
</execution>
113+
</executions>
114+
</plugin>
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-gpg-plugin</artifactId>
118+
<version>1.5</version>
119+
<executions>
120+
<execution>
121+
<id>sign-artifacts</id>
122+
<phase>verify</phase>
123+
<goals>
124+
<goal>sign</goal>
125+
</goals>
126+
</execution>
127+
</executions>
128+
</plugin>
38129
</plugins>
39130
</build>
40131

@@ -53,4 +144,6 @@
53144
</dependency>
54145
</dependencies>
55146

147+
148+
56149
</project>

src/main/java/statemachine/StateMachine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ public State getState() {
9090

9191
/**
9292
* Sets the current state of the StateMachine
93-
* @param newState The new state that will be set as the current state
93+
* @param state The new state that will be set as the current state
9494
*/
9595
protected void setState(State state) {
9696
this.currentState = state;
9797
}
9898

9999
/**
100100
* Sets the current state of the StateMachine and runs this state's action
101-
* @param newState The new state that will be set as the current state
101+
* @param state The new state that will be set as the current state
102102
*/
103103
public void setStateAndRunAction(State state) {
104104
this.currentState = state;

src/main/java/states/IState.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,56 +23,65 @@ public interface IState {
2323

2424
/**
2525
* The start command does only have an effect in {@link IdleState}. With this command, the state machine will change to the {@link ExecuteState}
26+
* @param stateMachine A reference to the current {@link StateMachine} instance
2627
*/
2728
public void start(StateMachine stateMachine);
2829

2930
/**
3031
* The hold command is used when interal reasons of a machine should bring it to an halt. Such reasons could be e.g. necessary refill of material.
3132
* With this command, the state machine will transition to a {@link HoldingState} and eventually come to a full {@link HeldState}.
33+
* @param stateMachine A reference to the current {@link StateMachine} instance
3234
*/
3335
public void hold(StateMachine stateMachine);
3436

3537
/**
3638
* The unhold command brings the machine into an {@link UnholdingState} that eventually leads back to the {@link ExecuteState}. The hold command
3739
* should be used when the internal reasons that brought a machine into a {@link HeldState} have been cleared.
40+
* @param stateMachine A reference to the current {@link StateMachine} instance
3841
*/
3942
public void unhold(StateMachine stateMachine);
4043

4144
/**
4245
* The suspend command is used when extenal reasons of a machine should bring it to an halt. Such reasons could be e.g. waiting for following
4346
* machines to accept a workpiece. With this command, the state machine will transition to a {@link SuspendingState} and eventually come to a full
4447
* {@link SuspendedState}.
48+
* @param stateMachine A reference to the current {@link StateMachine} instance
4549
*/
4650
public void suspend(StateMachine stateMachine);
4751

4852
/**
4953
* The unsuspend command brings the machine into an {@link UnsuspendingState} that eventually leads back to the {@link ExecuteState}. The
5054
* unsuspend command should be used when the external reasons that brought a machine into a {@link SuspendedState} have been cleared.
55+
* @param stateMachine A reference to the current {@link StateMachine} instance
5156
*/
5257
public void unsuspend(StateMachine stateMachine);
5358

5459
/**
5560
* The reset command brings the machine into a {@link ResettingState} that eventually leads back to the {@link IdleState}. The reset command can
5661
* be used when the machine has been brought to a sudden halt (e.g. with stop or abort command)
62+
* @param stateMachine A reference to the current {@link StateMachine} instance
5763
*/
5864
public void reset(StateMachine stateMachine);
5965

6066
/**
6167
* The stop command can be triggered by an external system such as an MES. Stop brings the state machine to a {@link StoppingState} and from there
6268
* to a {@link StoppedState}. The currently produced product should not be destroyed and production can continue after the machine has been reset.
69+
* @param stateMachine A reference to the current {@link StateMachine} instance
6370
*/
6471
public void stop(StateMachine stateMachine);
6572

6673
/**
6774
* The abort command can be triggered by an external system such as an MES. Abort brings the state machine to a sudden stop by transitioning to
6875
* the {@link AbortingState} and eventually to the {@link AbortedState}. The machine is switched off, the currently produced product might have to
6976
* be destroyed and production of it can not be continued.
77+
* @param stateMachine A reference to the current {@link StateMachine} instance
7078
*/
7179
public void abort(StateMachine stateMachine);
7280

7381
/**
7482
* After a machine has been brought to the {@link AbortedState}, a clear command can be used to bring it to a {@link ClearingState} to e.g. remove
7583
* destroyed products. From the {@link ClearingState}, the machine will come to the {@link StoppedState} from which it then can be reset.
84+
* @param stateMachine A reference to the current {@link StateMachine} instance
7685
*/
7786
public void clear(StateMachine stateMachine);
7887

src/main/java/states/State.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public void executeActionAndComplete(StateMachine stateMachine) {
1414

1515
/**
1616
* Default of a simple runAction implementation. Could be overriden if e.g. an action has to run in a separate thread
17-
* @param action
17+
* @param action {@link IStateAction} that is going to be executed
1818
*/
1919
protected void executeAction(IStateAction action) {
2020
action.execute();

src/main/java/states/impl/SuspendedState.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ public void reset(StateMachine stateMachine) {
3434
// Reset cannot be fired from Suspended -> Do nothing except maybe giving a warning
3535
}
3636
@Override
37-
public void stop(StateMachine stateMachine) {
38-
// Stop cannot be fired from Suspended -> Do nothing except maybe giving a warning
39-
}
40-
@Override
41-
public void abort(StateMachine stateMachine) {
42-
// Abort cannot be fired from Suspended -> Do nothing except maybe giving a warning
43-
}
44-
@Override
4537
public void clear(StateMachine stateMachine) {
4638
// Clear cannot be fired from Suspended -> Do nothing except maybe giving a warning
4739
}

0 commit comments

Comments
 (0)