Skip to content

Commit

Permalink
Documented generate helper.
Browse files Browse the repository at this point in the history
  • Loading branch information
pme123 committed Dec 11, 2024
1 parent 016c7ab commit c710de3
Show file tree
Hide file tree
Showing 45 changed files with 306 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Here we focus on the first step.

1. We can use the same `helperCompany.scala` script, we created in the [Init Company] step.
```scala
cd ~/dev-myCompany
cd ~/dev-mycompany
./helperCompany.scala project myProject
```
This creates:

```bash
dev-myCompany
dev-mycompany
| projects
| | myProject
| | | helper.scala
Expand All @@ -29,17 +29,17 @@ cd ~/projects/myProject
chmod +x helper.scala
```

1. Open the `myCompany-myProject` directory with your IDE (I use Intellij).
1. Open the `mycompany-myProject` directory with your IDE (I use Intellij).

@:callout(info)
If you haven't released `company-camundala` yet,
you need to run it at least locally (`sbt publishLocal`)
and set the version in the `helper.scala` manually.

```scala
//> using dep myCompany::myCompany-camundala-helper:VERSION NOT FOUND
//> using dep mycompany::mycompany-camundala-helper:VERSION NOT FOUND
// replace with:
//> using dep myCompany::myCompany-camundala-helper:0.1.0-SNAPSHOT
//> using dep mycompany::mycompany-camundala-helper:0.1.0-SNAPSHOT
```

@:@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

laika.navigationOrder = [
development.md
intro.md
initCompany.md
createProject.md
projectDev.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ So try to stick to the conventions, whenever possible.

1. Create a directory for your company development:
```bash
mkdir ~/dev-myCompany
mkdir ~/dev-mycompany
```

Be aware that the company name (_mycompany_) must be lowercase to work properly.

1. Create `helperCompany.scala` in your company directory and open it.
```bash
cd ~/dev-myCompany
cd ~/dev-mycompany
touch helperCompany.scala
open helperCompany.scala
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Development
# Introduction

## Pre-Requisites
**_Camundala_** is written in _**Scala**_ and provides _Scala DSLs_.
Expand Down
198 changes: 198 additions & 0 deletions 00-documentation/src/docs/development/projectDev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# Project Development
**Experimental**

The following chapters describe the tasks to support the project development.

We provide a `helper.scala` script that helps you with the most common tasks.

In general, you can type `./helper.scala x` to get a list of available commands.

And then you can type `./helper.scala <command>` to get help for a specific command.

The `version` is optional and defaults to `1`.

## update
Whenever you have changes in the `company-camundala` project or in one of your dependencies,
you can update the project with the following command:

```bash
./helper.scala update
```

This will create or update your project with the latest changes.

Files that contain the `DO NOT ADJUST` comment will be replaced.
If you do adjust them, remove this comment.
You will get a warning, but the file will not be replaced.

## Generate Process/-Elements
To handle name conventions and to avoid errors, we generate as much as possible.

So it is essential, not to change the generated names.

The following generators are provided:

### process
Creates a new Process.

Usage:
```
./helper.scala process <processName> [version: Int]
```

Example:
```
./helper.scala process myProcess 1
```

This creates the following files:
```
// the BPMN
src - main -> myproject-myProcessV1.bpmn
// the domain In -> Out
02-bpmn - main -> mycompany.myproject.bpmn.myProcess.v1.MyProcess
// the Simulation
03-simulation - test -> mycompany.myproject.simulation.MyProcessSimulation
// the InitWorker
03-worker - main -> mycompany.myproject.worker.myProcess.v1.MyProcessWorker
- test -> mycompany.myproject.worker.myProcess.v1.MyProcessWorkerTest
```

### customTask
Creates a new Custom Task.

Usage:
```
./helper.scala customTask <processName> <bpmnName> [version: Int]
```

Example:
```
./helper.scala customTask myProcess MyCustomTask 1
```

This creates the following files:
```
// the domain In -> Out
02-bpmn - main -> mycompany.myproject.bpmn.myProcess.v1.MyCustomTask
// the CustomWorker
03-worker - main -> mycompany.myproject.worker.myProcess.v1.MyCustomTaskWorker
- test -> mycompany.myproject.worker.myProcess.v1.MyCustomTaskWorkerTest
```

### serviceTask
Creates a new Service Task.

Usage:
```
./helper.scala serviceTask <processName> <bpmnName> [version: Int]
```

Example:
```
./helper.scala serviceTask myProcess MyServiceTask 1
```

This creates the following files:
```
// the domain In -> Out (ServiceIn -> ServiceOut)
02-bpmn - main -> mycompany.myproject.bpmn.myProcess.v1.MyServiceTask
// the ServiceWorker
03-worker - main -> mycompany.myproject.worker.myProcess.v1.MyServiceTaskWorker
- test -> mycompany.myproject.worker.myProcess.v1.MyServiceTaskWorkerTest
```

### userTask
Creates a new User Task.

Usage:
```
./helper.scala userTask <processName> <bpmnName> [version: Int]
```

Example:
```
./helper.scala userTask myProcess MyUserTask 1
```

This creates the following files:
```
// the domain In -> Out
02-bpmn - main -> mycompany.myproject.bpmn.myProcess.v1.MyUserTask
```

### decision
Creates a new Decision.

Usage:
```
./helper.scala decision <processName> <bpmnName> [version: Int]
```

Example:
```
./helper.scala decision myProcess MyDecision 1
```

This creates the following files:
```
// the domain In -> Out
02-bpmn - main -> mycompany.myproject.bpmn.myProcess.v1.MyDecision
```

### signalEvent
Creates a new Signal Event.

Usage:
```
./helper.scala signalEvent <processName> <bpmnName> [version: Int]
```

Example:
```
./helper.scala signalEvent myProcess MySignalEvent 1
```

This creates the following files:
```
// the domain In -> NoOutput
02-bpmn - main -> mycompany.myproject.bpmn.myProcess.v1.MySignalEvent
```

### messageEvent
Creates a new Message Event.

Usage:
```
./helper.scala messageEvent <processName> <bpmnName> [version: Int]
```

Example:
```
./helper.scala messageEvent myProcess MyMessageEvent 1
```

This creates the following files:
```
// the domain In -> NoOutput
02-bpmn - main -> mycompany.myproject.bpmn.myProcess.v1.MyMessageEvent
```

### timerEvent
Creates a new Timer Event.

Usage:
```
./helper.scala timerEvent <processName> <bpmnName> [version: Int]
```

Example:
```
./helper.scala timerEvent myProcess MyTimerEvent 1
```

This creates the following files:
```
// the domain NoInput -> NoOutput
02-bpmn - main -> mycompany.myproject.bpmn.myProcess.v1.MyTimerEvent
```
1 change: 1 addition & 0 deletions 00-documentation/src/docs/directory.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ laika.navigationOrder = [
technologies.md
generalConcerns.md
functionalityDsls
development
]
Loading

0 comments on commit c710de3

Please sign in to comment.