20
PE Curiosity Fun Precision Knowledge

BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

Embed Size (px)

Citation preview

Page 1: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

PECuriosity

FunPrecision

Knowledge

Page 2: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

SnapshotsOutput

States

Motors

Queries

Sensors

Page 3: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

TiltedTwister 2.0 *

* Source: Hans Andersson - http://tiltedtwister.com/tiltedtwister2.html

CubeSolving

public class ScanBrickListener implements ExecutionListener {

public void notify(DelegateExecution execution) throws Exception {Number brickNo = (Number) execution.getVariable("brickNo");

String brickColor = (String) execution.getVariable("brickColor");

Page 4: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

Turn Table

Cube Tilter

Brick

Color Sensor

Page 5: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

PC/Remote API

Sensor/Motor Port API

Page 6: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

JAR

Java Application

Page 7: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa
Page 8: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa
Page 9: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa
Page 10: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

Main Process

Name Value

Subprocess

Name Value

Page 11: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

Main Process

Scan single Brick

React on Cube

Walk CubeScan Face

Face

DMNScan all Bricks

Rotate Motor

Scan Cube Calculate Solve Cube

Face to

Face

Move

Face

Move

DMN

TwistTiltTurn

Page 12: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

Robot Access Delegate Layer

Brick Access Factory

«JavaDelegate»

Data Objects

CubeFinder Functions RotateDelegate

FetchSampleDelegate

new MotorFactory()

new SensorFactory()

Very Static Model static Motor.A

static SensorPort.S1

Page 13: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

Process

public class RotateDelegate implements JavaDelegate {

private FixedValue port;

private JuelExpression angle;

Page 14: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

@Override

public void execute(DelegateExecution execution)

throws Exception {

String portValue = (String) port.getValue(execution);

Long angleValue = (Long) angle.getValue(execution);

String hostVar = ""+execution.getVariable("Host");

// leJOS API stuff here

}

Page 15: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

public class

ProcessTestCubeFinderMain {

@Test

public void startProcess()

throws RemoteException {

repositoryService

.createDeployment()

.addInputStream(

"cubeFinderMain.bpmn20.xml",

mainPath))

.addInputStream(

"scan.bpmn20.xml",

scanPath)

.deploy();

}}

Run as …

Page 16: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

Brick.java

Page 17: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

RotateDelegate.java

Page 18: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa

FetchSampleDelegate.java

Page 19: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa
Page 20: BPMCon 2016: LEGO Mindstorms Steuerung mit BPMN, Oliver Hock, Videa