Firstly, run the definition-service:
cd definition-service
mvn spring-boot:run
And then, register the process definition to the definition-service with the following command:
http :9093/definition/raw/sales/simpleProcess.xml < definition-samples/simpleProcess.xml
Run the process-service:
cd process-service
mvn spring-boot:run
Start a process:
http :9094/instance processDefinitionId="sales/testProcess.xml" "roleMappings[0][name]=initiator" "roleMappings[0][endpoints][0][email protected]" "roleMappings[0][resourceNames][0]=Initiator" "Authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNzEzMTUzODU0LCJpYXQiOjE3MTMxNTAyNTQsImlzcyI6Imh0dHA6Ly8xMjcuMC4wLjE6NTQzMjEvYXV0aC92MSIsInN1YiI6IjY3NjFhZTEyLTlkZjYtNDg5Mi1iMGZiLTFlNTNlYjJhMzljNiIsImVtYWlsIjoieWFuZzE3NjJAdWVuZ2luZS5vcmciLCJwaG9uZSI6IiIsImFwcF9tZXRhZGF0YSI6eyJwcm92aWRlciI6ImVtYWlsIiwicHJvdmlkZXJzIjpbImVtYWlsIl19LCJ1c2VyX21ldGFkYXRhIjp7Im5hbWUiOiJ5YW5nMTc2MiJ9LCJyb2xlIjoiYXV0aGVudGljYXRlZCIsImFhbCI6ImFhbDEiLCJhbXIiOlt7Im1ldGhvZCI6InBhc3N3b3JkIiwidGltZXN0YW1wIjoxNzEzMTUwMjU0fV0sInNlc3Npb25faWQiOiIwMzg0ODFkYy03Y2JmLTRiODQtYWNmYS00NzMzOTZhMWI0MzIifQ.izL0kiUzAUh1HNsCl4ahm_UiindR2CSr5iMtSyCKPhU"
Confirm the RoleMapping:
http http://localhost:9094/instance/1/role-mapping/
must return the initiator's endpoint value as "[email protected]"
http POST :9094/instance 'processDefinitionId=sales/testLaneProcess.xml' 'roleMappings[0][name]=initiator' 'roleMappings[0][endpoints][0]=manager' 'roleMappings[0][resourceNames][0]=Initiator' 'Authorization:Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiA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1EmuSshUlvzkD6jTUKWUb8HgSbX6iqdEok1ou478g1IBA0UEqa3pdcYeVMnYS0153P4XgG1gnaQRVCNSqHqjxFXlQrWNDU2V5Y71rJmn8AkvTCHojJbo0cM5kNTc3HwMaJPE1C3Ira8kBUPqJTtspUh7RWI1WADmV59JYdlI_eaAlnFJdvrEAxErK3vgWPoSO2gJSYCL0_nH1TGTcTRENm8wOSvQjCu98aJLey_pQhdTJ1bM8jUlOVhJlXBKcz-zmPJmq2cKa0qA4s8Y8r8DfrdMgQsdUU339E2GZ9fhCmvEhRQ0023D3GHZgiibRIEKZO_35a1iRaaQDIzg'
http POST :9094/instance processDefinitionId="sales/testLaneProcess.xml" roleMappings[0][name]="initiator" roleMappings[0][endpoints][0]="manager" roleMappings[0][resourceNames][0]="Initiator" 'Authorization:Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJJUmdaSjhxSW9EV3RNcDMteGJhUVIwcFVhYVUxZFhlNThYNW1PVmh6NkFJIn0.eyJleHAiOjE3MTI5MDA3NzEsImlhdCI6MTcxMjkwMDQ3MSwiYXV0aF90aW1lIjoxNzEyODk3MjI1LCJqdGkiOiIzNmQ1NDVlMS01MDVjLTQ1ZWItYWYzNi1hMjg5MzMyOTRmZDUiLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjkwOTAvcmVhbG1zL3VlbmdpbmU2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6IjU1MzRmYmMwLWZmNWYtNDk3MS1hNzEwLWRhNjk5NWFkNGM2YiIsInR5cCI6IkJlYXJlciIsImF6cCI6InVlbmdpbmUiLCJub25jZSI6IjUzZTJkMTc2LWY0MGEtNDM2YS1hYjdhLWQ5NWU0OTBjYWY0ZSIsInNlc3Npb25fc3RhdGUiOiJmOWNlMjhjMy05YjY4LTQyYWItOTQ5Zi1jZmYxNTNlMGJmZGEiLCJhY3IiOiIwIiwiYWxsb3dlZC1vcmlnaW5zIjpbIioiXSwicmVhbG1f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hdTJ1bM8jUlOVhJlXBKcz-zmPJmq2cKa0qA4s8Y8r8DfrdMgQsdUU339E2GZ9fhCmvEhRQ0023D3GHZgiibRIEKZO_35a1iRaaQDIzg"
http POST :9094/instance processDefinitionId="sales/TroubleAlertTest" "roleMappings[0][name]=alert" "roleMappings[0][endpoints][0]=manager" "roleMappings[1][name]=manager" "roleMappings[1][endpoints][0]=manager" 'Authorization:Bearer $KEY'
http POST :9094/work-item/2/complete desiredState="complete" 'Authorization:Bearer $KEY'