Integrations

The JSON configurations below can be pasted into the editor via the Import/Export popup.

Send webhook message to endpoint on insert/change

This example will send a webhook message to the endpoint when a person will be inserted or updated. Of course it is possible to add some more checks in front to filter the situations.

This example is triggered from an insert or update on a person.

Steps:

  • Create basic authentication object with username and password to authorize against endpoint.
  • Call webhook with authorization selected. Provide endpoint and headers (when applicable). The content of the message can also be provided and [TYPE] and [PK] will be replaced by the actual (UD)BO type and primarykey of the triggering (UD)BO.

Corresponding configuration:

{"drawflow":{"Home":{"data":{"2":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"106"}]}},"pos_y":865,"pos_x":-1740.25,"data":{"checksum":"d2fce82acf4f0e23ffac5abbd000b51719862cde719149a33cfc2b049d2b62cd","basebo":"Person","confversion":"723","appversion":"2.10.0","solutiontype":"SX"},"inputs":{},"name":"Start of flow","html":"","id":2,"class":"start"},"105":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"107"}]}},"pos_y":868,"pos_x":-1106.5,"data":{"authorization":"@basic","endpoint":"https://www.google.com","comments":"{\n  \"type\" : \"[TYPE]\",\n  \"pk\" : [PK]\n}","dataobject":"Target","requestheaders":"Content-Type:application/json"},"inputs":{"input_1":{"connections":[{"node":"106","input":"output_1"}]}},"name":"Call webhook","html":"","id":105,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.webservice.Webhook"},"106":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"105"}]}},"pos_y":865.75,"pos_x":-1402,"data":{"elementname":"basic","password":"SyeQzxNe3LushpemG2twQ3aiRm2LtOgATzcRH9CXXxR+yryfv34uPS94timhyGnl","username":"test"},"inputs":{"input_1":{"connections":[{"node":"2","input":"output_1"}]}},"name":"Basic HTTP Auth","html":"","id":106,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.webservice.authorization.BasicAuthentication"},"107":{"typenode":false,"outputs":{},"pos_y":866.5,"pos_x":-776.25,"data":{"errorid":"9453","message":"%s"},"inputs":{"input_1":{"connections":[{"node":"105","input":"output_1"}]}},"name":"Show warning","html":"","id":107,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.notification.Warning"}}}}}

Incoming webservice

This example will process an incoming webservice call. The request is sent by an external application to the endpoint https://<environment>/sdk/platform/jaxrs/planonsoftware/apps/configurablebusinessrule/module/endpoint/<configuration code>

and will be processed directly. It is also possible to send a request to the EventConnector endpoint.

https://<environment>/sdk/platform/jaxrs/planonsoftware/apps/configurablebusinessrule/module/endpointec/<configuration code>

This will result in a inbound message and will be processed in the background. The response of the request will be the UUID of the InboundMessage.

{
    "message": "This message is queued and will be processed as soon as possible.",
    "uuid": "abf865bc-aa50-46c1-8f61-5e23c449848b"
}

Example steps:

  • Search Person based on its ID (Code).
  • Copy the firstname field from the request to the FirstName field of the Person
  • Save the Person
  • Add the Field status to the response which will be returned to the calling system.
  • In case of an error set response field Error to ‘Person not found’ and HTTP response code to 404.

Example success request (Postman):

Will result in:

Providing a code which does not exist will result in:

Corresponding configuration:

{"drawflow":{"Home":{"data":{"2":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"31"}]}},"pos_y":224,"pos_x":114,"data":{"checksum":"832354c4644b352868af8432b95d5accbfbe1b86a818ebc6af11408aac9e5f99","basebo":"","confversion":"310","appversion":"2.10.0","solutiontype":"WS"},"inputs":{},"name":"Start of flow","html":"","id":2,"class":"start"},"31":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"33"}]}},"pos_y":227,"pos_x":427,"data":{"elementname":"id","dataobject":"Source"},"inputs":{"input_1":{"connections":[{"node":"2","input":"output_1"}]}},"name":"Get field value (S)","html":"","id":31,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.GetElementStatic"},"33":{"typenode":false,"outputs":{"output_2":{"connections":[{"output":"input_1","node":"35"}]},"output_1":{"connections":[{"output":"input_1","node":"34"}]}},"pos_y":229,"pos_x":719,"data":{"elementname":"Person"},"inputs":{"input_1":{"connections":[{"node":"31","input":"output_1"}]}},"name":"Find by lookup","html":"","id":33,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.FindByLookup"},"34":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"38"}]}},"pos_y":-47,"pos_x":1002,"data":{"targetelementname":"FirstName","elementname":"firstname","targetdataobject":"@Person","dataobject":"Source"},"inputs":{"input_1":{"connections":[{"node":"33","input":"output_1"}]}},"name":"Copy value of field","html":"","id":34,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.CopyElement"},"35":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"37"}]}},"pos_y":602,"pos_x":995,"data":{"elementname":"Error","staticvalue":"Person not found","dataobject":"Target"},"inputs":{"input_1":{"connections":[{"node":"33","input":"output_2"}]}},"name":"Set String field","html":"","id":35,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.SetElementStaticString"},"36":{"typenode":false,"outputs":{"output_1":{"connections":[]}},"pos_y":600,"pos_x":1550,"data":{"dataobject":"Target"},"inputs":{"input_1":{"connections":[{"node":"37","input":"output_1"}]}},"name":"Set HTTP Code","html":"","id":36,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.webservice.SetHTTPCode"},"37":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"36"}]}},"pos_y":604,"pos_x":1270,"data":{"staticvalue":"404"},"inputs":{"input_1":{"connections":[{"node":"35","input":"output_1"}]}},"name":"Static Integer","html":"","id":37,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.StaticInteger"},"38":{"typenode":false,"outputs":{"output_1":{"connections":[{"output":"input_1","node":"39"}]}},"pos_y":-49,"pos_x":1268,"data":{"dataobject":"@Person"},"inputs":{"input_1":{"connections":[{"node":"34","input":"output_1"}]}},"name":"Save data","html":"","id":38,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.Save"},"39":{"typenode":false,"outputs":{"output_1":{"connections":[]}},"pos_y":-48,"pos_x":1533,"data":{"elementname":"Status","staticvalue":"Success","dataobject":"Target"},"inputs":{"input_1":{"connections":[{"node":"38","input":"output_1"}]}},"name":"Set String field","html":"","id":39,"class":"planonsoftware.apps.configurablebusinessrule.logic.functions.implementations.element.SetElementStaticString"}}}}}