MBaaS Connector for Red Hat Mobile Application Platform (RHMAP)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
public
test
.gitignore
.jshintrc
.travis.yml
Grunt-ReadMe.md
Gruntfile.js
LICENSE
README.md
application.js
package.json

README.md

BPM MBaaS Service

This is a BPM mBaaS service for working with the REST API of JBoss BPM Suite V6.x (https://docs.jboss.org/jbpm/v6.3/userguide/ch17.html).

UPDATE 2017-04-21: Note that in order for the fh-connector-bpm to call the BPM REST API the user passed as BPM_AUTH_USERNAME needs to have the role 'rest-all' configured. See https://access.redhat.com/solutions/2146121

Also note that BPM 6.4.0 requires EAP 6.4.11, otherwise this error might occur: https://access.redhat.com/solutions/2155931 END OF UPDATE

The following environment variables need to be defined to create a connection to your JBoss BPM Suite. Alternatively you can leave them empty and define a connection in your mobile App. But note! This mBaaS will always take the environment variables, if they are defined.

  • BPM_URI_HOSTNAME = mybpmserver.example.com
  • BPM_URI_PORT = 8080
  • BPM_AUTH_USERNAME = username
  • BPM_AUTH_PASSWORD = mypassword

By setting the following environment variables you define a process which you want to interact with.

Group BPM API

PROCESS MANAGAMENT: Start process [/bpm/startProcess]

VERY IMPORTANT: The content type of the request must be set: "Content-Type: application/json"

startProcess [POST]

Starts a new process instance from the given template identified by "process-id".

  • Request (application/json)

    • Body { "processInput01": "This is my value.", "processInput02": "This is another value..." }
  • Response 200 (application/json)

    • Body { "id":1, "state":2, "parentProcessInstanceId":0, "status":"SUCCESS", "url":"/business-central/rest/runtime/test:stp:1.0/process/stp.my-process/start", "index":null, "process-id":"stp.my-process", "event-types":[] }

PROCESS MANAGAMENT: Get process image [/bpm/processImage]

getProcessImage [GET]

Get the process SVG

Add the query parameter id to get instance image, e.g.

/bpm/processImage?id=1

PROCESS MANAGAMENT: Get process instance [/bpm/getProcessInstance]

VERY IMPORTANT: The content type of the request must be set: "Content-Type: application/json"

getProcessInstance [POST]

Gets basic information about a certain process instance

  • Request (application/json)

    • Body { "procInstId": "1" }
  • Response 200 (application/json)

    • Body { "status":"SUCCESS", "url":"/business-central/rest/runtime/test:stp:1.0/withvars/process/instance/2", "variables": { "processInput01": "This is my value.", "processInput02": "This is another value..." "initiator":"username" }, "processInstance": { "id":2, "state":1, "parentProcessInstanceId":0, "process-id":"stp.my-process", "event-types":[] } }

TASK MANAGAMENT: Load tasks [/bpm/loadTasks]

VERY IMPORTANT: The content type of the request must be set: "Content-Type: application/json"

loadTasks [POST]

Gets all the task. Username, password, IP and port are optional values.

  • Request (application/json)

    • Body { "params":{ "username": "username", "password": "password", "ip": "Your BPM IP", "port": "Your BPM Port" } }
  • Response 200 (application/json)

    • Body { "status":null, "url":null, "index":null, "commandName":null, "taskSummaryList":[{ "@class":"org.kie.services.client.serialization.jaxb.impl.task.JaxbTaskSummary", "id":15, "name":"handle_problem", "subject":"", "description":"", "status":"Ready", "priority":0, "skipable":true, "actualOwnerId":null, "createdById":null, "createdOn":1463068007279, "activationTime":1463068007279, "expirationTime":null, "processInstanceId":15, "processId":"IoT_Human_Task.low_voltage", "processSessionId":2, "deploymentId":"com.redhat.demo.iot.datacenter:HumanTask:1.0", "quickTaskSummary":false, "parentId":-1, "potentialOwners":null }], "pageNumber":null, "pageSize":null }

TASK MANAGAMENT: Load task content [/bpm/loadTaskContent]

VERY IMPORTANT: The content type of the request must be set: "Content-Type: application/json"

loadTaskContent [POST]

Gets the content of a specific task. TASKID is required! Username, password, IP and port are optional values.

  • Request (application/json)

    • Body { "params":{ "username": "username", "password": "password", "ip": "Your BPM IP", "port": "Your BPM Port", "taskId": "ID" } }
  • Response 200 (application/json)

    • Body { "id":41, "content":"rO0ABXoAAAG/CgYIBhADGABK4gEIABJIb3JnLmRyb29scy5jb3JlLm1hcnNoYWxsaW5nLmltcGwuU2VyaWFsaXphYmxlUGxhY2Vob2xkZXJSZXNvbHZlclN0cmF0ZWd5GpMBrO0ABXNyABNqYXZhLnV0aWwuQXJyYXlMaXN0eIHSHZnHYZ0DAAFJAARzaXpleHAAAAAKdwQAAAAKdAAEdGVzdHQABHRlc3R0AAR0ZXN0dAAEdGVzdHQABHRlc3R0AAR0ZXN0dAAEdHJ1ZXQADUhhbmRsZVByb2JsZW10AAR1c2VydAAOaGFuZGxlX3Byb2JsZW14Us8BChMKCXRpbWVzdGFtcBAAGgQAAAAAChYKDGVycm9yTWVzc2FnZRAAGgQAAAABChQKCmRldmljZVR5cGUQABoEAAAAAgoSCghkZXZpY2VJRBAAGgQAAAADChMKCWVycm9yQ29kZRAAGgQAAAAEChEKB3BheWxvYWQQABoEAAAABQoTCglTa2lwcGFibGUQABoEAAAABgoSCghUYXNrTmFtZRAAGgQAAAAHChEKB0dyb3VwSWQQABoEAAAACAoSCghOb2RlTmFtZRAAGgQAAAAJ", "contentMap":{ "errorMessage":"test", "timestamp":"test", "deviceType":"test", "deviceID":"test", "errorCode":"test", "payload":"test", "Skippable":"true", "TaskName":"HandleProblem", "GroupId":"user", "NodeName":"handle_problem" } }

TASK MANAGAMENT: Claim task [/bpm/claimTask]

VERY IMPORTANT: The content type of the request must be set: "Content-Type: application/json"

claimTask [POST]

Claims a task. TASKID is required! Username, password, IP and port are optional values.

  • Request (application/json)

    • Body { "params":{ "username": "username", "password": "password", "ip": "Your BPM IP", "port": "Your BPM Port", "taskId": "ID" } }
  • Response 200 (application/json)

    • Body { "status":"SUCCESS", "url":"/business-central/rest/task/15/claim", "message":null }

TASK MANAGAMENT: Complete task [/bpm/completeTask]

VERY IMPORTANT: The content type of the request must be set: "Content-Type: application/json"

completeTask [POST]

Completes a task. TASKID is required! Username, password, IP and port are optional values.

  • Request (application/json)

    • Body { "params":{ "username": "username", "password": "password", "ip": "Your BPM IP", "port": "Your BPM Port", "taskId": "ID" } }
  • Response 200 (application/json)

    • Body { "status":"SUCCESS", "url":"/business-central/rest/task/15/complete", "message":null }

TASK MANAGAMENT: Release task [/bpm/releaseTask]

VERY IMPORTANT: The content type of the request must be set: "Content-Type: application/json"

releaseTask [POST]

Completes a task. TASKID is required! Username, password, IP and port are optional values.

  • Request (application/json)

    • Body { "params":{ "username": "username", "password": "password", "ip": "Your BPM IP", "port": "Your BPM Port", "taskId": "ID" } }
  • Response 200 (application/json)

    • Body { "status":"SUCCESS", "url":"/business-central/rest/task/15/release", "message":null }

TASK MANAGAMENT: Start task [/bpm/startTask]

VERY IMPORTANT: The content type of the request must be set: "Content-Type: application/json"

startTask [POST]

Starts a task. TASKID is required! Username, password, IP and port are optional values.

  • Request (application/json)

    • Body { "params":{ "username": "username", "password": "password", "ip": "Your BPM IP", "port": "Your BPM Port", "taskId": "ID" } }
  • Response 200 (application/json)

    • Body { "status":"SUCCESS", "url":"/business-central/rest/task/15/start", "message":null }