1. Create or download project described in "How To Create Simple Java Workflow"

Download java project – WorkflowExample.zip

 

2. In Studio for project "WorkflowExample" create source folder "src/main/resources";

3. Add image in png format with name like your custom block.

for example, for custom block "org.neuro4j.workflow.tutorial.HelloWorld.java" add icon "org.neuro4j.workflow.tutorial.HelloWorld.png" (64x52)

For WorkflowExample.zip just rename HelloWorld_.png to HelloWorld.png

4. Update pom.xml, add resources folder.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.neuro4j.workflow.tutorial</groupId>
	<artifactId>WorkflowExample</artifactId>
	<packaging>jar</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>WorkflowExample</name>
	<url>http://maven.apache.org</url>

	<repositories>
		<repository>
			<id>neuro4j-maven-milestone</id>
			<name>Neuro4J Maven Repository</name>
			<url>http://static.neuro4j.org/maven2</url>
		</repository>
	</repositories>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<org.neuro4j.version>2.0.1</org.neuro4j.version>
		<java.version>1.6</java.version>
		<logback.version>1.0.13</logback.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.neuro4j</groupId>
			<artifactId>neuro4j-workflow-common</artifactId>
			<version>${org.neuro4j.version}</version>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>${logback.version}</version>
		</dependency>
	</dependencies>	
	<build>	
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<includes>
					<include>**/*.n4j</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<include>**/*.png</include>
				</includes>
			</resource>			
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

5. Open flow "org.neuro4j.workflow.tutorial.HelloFlow.n4j"

What's next?