forked from citilinkru/camunda-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
processinstance.go
38 lines (31 loc) · 863 Bytes
/
processinstance.go
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
package main
import (
"flag"
"fmt"
camundaclientgo "github.com/Badgain/camunda-go/v3"
"os"
"time"
)
var historyId string
func init() {
flag.StringVar(&historyId, "id", "", "The id of the historic process instance to be retrieved")
flag.Parse()
}
func main() {
if historyId == "" {
fmt.Println("Please use flag `--id` (The `id` of the historic process instance to be retrieved)")
os.Exit(1)
}
client := camundaclientgo.NewClient(camundaclientgo.ClientOptions{
EndpointUrl: "http://localhost:8080/engine-rest",
ApiUser: "demo",
ApiPassword: "demo",
Timeout: time.Second * 10,
})
processInstance, err := client.History.GetProcessInstance(historyId)
if err != nil {
fmt.Printf("Can't get history Process Instance: %s\n", err)
os.Exit(1)
}
fmt.Printf("Response Process Instance from history:\n %#+v\n", processInstance)
}