Traveling Salesperson Problem with Salesforce Functions

Related tags

GUI routeplanner-sfx
Overview

Lightning Function Demos

Node.js + Platform Events

This demo uses a combination of Flow, Evergreen Functions, CDC, and Lightning Web Components.

Rough demo flow:

  • Open account record
  • Click Quick Action "New Delivery"
  • Enter data in Flow, which will create a Platform Event
  • Wait for "Current Deliveries" to update (CDC listens in LWC)

Salesforce org setup

  1. Create scratch org.
sfdx force:org:create -s -f config/project-scratch-def.json -a routeplannerdemo
  1. Push source to scratch org.
sfdx force:source:push
  1. Assign permissionset
sfdx force:user:permset:assign -n RoutePlanner
  1. Import sample data
sfdx force:data:tree:import -p data/Account-Service__c-plan.json
  1. Open the org
sfdx force:org:open
  1. In Setup go to Data -> Data Integration Rules, and activate Geocodes for Account Shipping Address.

Functions setup

As the DX is in flux this section only describes the minimum needed information.

  • The function for this demo is located in functions/RoutePlanner.
  • The permissionset to use is RoutePlanner - for function assignment and for the Platform Event assignment.

Route Planner Function

diagram

Once you complete the steps below to setup and run the Function you should see these records. DELIVERYROUTE__R.NAME shows the route the vehicle should take and NUMBER__C represents the waypoints on that route to each service location in the most optimal order.

DELIVERYPLAN__C                          DELIVERYROUTE__R.NAME  VEHICLENAME__C  NUMBER__C  SERVICE__R.NAME
───────────────────────────────────────  ─────────────────────  ──────────────  ─────────  ────────────────────────────
Delivery Plan @ 2019-02-09 15:43:09.845  R-00000000             Van             1          Delivery to Beniof Mansion
Delivery Plan @ 2019-02-09 15:43:09.845  R-00000000             Van             3          Delivery to Landmark
Delivery Plan @ 2019-02-09 15:43:09.845  R-00000001             Van             2          Delivery to Salesforce Tower
Delivery Plan @ 2019-02-09 15:43:09.845  R-00000001             Van             4          Delivery to Salesforce West

Local Development

On a terminal run the following:

cd functions/routeplanner
sfdx run:function:start

On another terminal run the following:

cd functions/routeplanner
sfdx run:function --url=http://localhost:8080 -p=@data/sample-payload.json
You might also like...

This is a very lightweight plugin for Velocity proxy. Have functions including tabList, pingList and global chat.

This is a very lightweight plugin for Velocity proxy. Have functions including tabList, pingList and global chat.

Essential-PlayerInfo This repo had been transported to our team, and will not be updated here. https://github.com/Team-Jackdaw/Essential-PlayerInfo In

Mar 4, 2022

Problem-solving - A repository to contain my submissions in various online judges.

Problem Solving A repository to contain my submissions in various online judges. beecrowd # Problem Title Solution 1000 Hello World! [Link] 1001 Extre

Nov 15, 2022

The CSES Problem Set is a collection of algorithmic programming problems.

The CSES Problem Set is a collection of algorithmic programming problems. The goal of the project is to create a comprehensive high quality problem se

Jan 5, 2022

The repository contains the solutions from the problem set of pepcoding dsa level 1.

DSA Level 1 Data Structures and Algorithms in Java Solve Here Class Notes   200 Hours   Level 1 [Beginner] This is for anybody who has not coded at-le

Oct 12, 2022

A visualizer for the percolation problem solved with Weighted Union Find

A visualizer for the percolation problem solved with Weighted Union Find

A visualizer for the percolation problem. Uses Weighted Union Find with Path Compression for solving the problem and StdDraw from alg4.jar to draw. Includes real-time flow which updates filled sites after every new site is opened.

Jan 19, 2022

The ANT HAL Service functions as a JNI wrapper for the ANT HAL.

Android ANT HAL Service v.4.0.0 - 25 Aug 2014 The ANT HAL Service functions as a JNI wrapper for the ANT HAL. The ANT Hal Service provides the messagi

Jun 11, 2022

This is the java/Maven application we are building to solve one real world problem.

timly This is the java/Maven application we are building to solve one real world problem. As in MLH we are working with fellows across the globe and e

Feb 16, 2022

A Local implementation of a java library functions to create a serverside and clientside application which will communicate over TCP using given port and ip address.

A Local implementation of a java library functions to create a serverside and clientside application which will communicate over TCP using given port and ip address.

A Local implementation of java library functions to create a serverside and clientside application which will communicate over TCP using given port and ip address.

Feb 12, 2022

Triple X is a 2D space game based on The Three-Body Problem

Triple X is a 2D space game based on The Three-Body Problem

Triple X is a 2D space game based on The Three-Body Problem, which is the famous sci-fi novel wrote by Cixin Liu.

Feb 19, 2022

2D space game based on The Three-Body Problem

2D space game based on The Three-Body Problem

Triple X Triple X is a 2D space game based on The Three-Body Problem, which is the famous sci-fi novel wrote by Cixin Liu. In this game, you would dri

Feb 19, 2022

8-Puzzle problem solved using the A* search algorithm.

8-Puzzle This program written in Java solves the 8-puzzle problem (and its natural generalizations) using the A* search algorithm. The Problem: The 8-

Jun 7, 2022

Este repositório é uma coleção de soluções comentadas dos desafios encontrados no tópico Problem Solving do site HackerRank.

Soluções HackerRank - Problem Solving Este repositório é uma coleção de soluções Java comentadas dos desafios encontrados no tópico Problem Solving do

Apr 14, 2022

A data dumper and typing generator for the KubeJS functions, constants and classes.

A data dumper and typing generator for the KubeJS functions, constants and classes.

ProbeJS A data dumper and typing generator for the KubeJS functions, constants and classes. Great thanks to @DAmNRelentless, @LatvianModder and @yeste

May 25, 2022

CodeGen - a secure, high efficiency, and offline-able software, it provides several useful functions

CodeGen - a secure, high efficiency, and offline-able software, it provides several useful functions

CodeGen Efficiency ToolBox Introduce Download References Issues and Suggestions Software Preview Introduce CodeGen is a secure, high efficiency, and o

Jan 4, 2023

Java with functions is a small java tools and utils library.

Java with functions is a small java tools and utils library.

Oct 14, 2022

esProc SPL is a scripting language for data processing, with well-designed rich library functions and powerful syntax, which can be executed in a Java program through JDBC interface and computing independently.

esProc SPL is a scripting language for data processing, with well-designed rich library functions and powerful syntax, which can be executed in a Java program through JDBC interface and computing independently.

esProc esProc is the unique name for esProc SPL package. esProc SPL is an open-source programming language for data processing, which can perform comp

Dec 27, 2022

Aix-bench, the Java benchmark for code synthesis problem.

AiXcoder NL2Code Evaluation Benchmark (aix-bench) 简体中文 Paper available: https://arxiv.org/abs/2206.13179 Introduction This is a method-level benchmark

Dec 12, 2022
Owner
null
DatasetCreator is a lightweight RESTFul client implementation of the Salesforce CRM Analytics External Data API.

DatasetCreator is a lightweight RESTFul client implementation of the Salesforce CRM Analytics External Data API. It has been deliberately developed with no 3rd party jars with the goal of being a lean, reliable and scalable solution.

Salesforce Platform 6 Dec 16, 2022
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.

Password4j is a Java user-friendly cryptographic library for hashing and checking passwords with different Key derivation functions (KDFs) and Cryptog

Password4J 246 Jan 5, 2023
Rolling hash functions in Java

Rolling hash functions in Java License: Apache 2.0 What is this? This is a set of Java classes implementing various recursive n-gram hashing technique

Daniel Lemire 73 Dec 14, 2022
Maven plugin to help creating CHANGELOG by keeping one format and solving merge request conflicts problem by extraction of new CHANGELOG entries to seperate files.

keep-changelog-maven-plugin CHANGELOG.md is one of the most important files in a repository. It allows others to find out about the most important cha

Piotr Zmilczak 22 Aug 28, 2022
Simple AnimationUtil using Easing functions. Can be used anywhere, Hacked-Client, Mods, etc..

AnimationUtil Simple AnimationUtil using Easing functions. Can be used anywhere, Hacked-Client, Mods, etc.. Render example > https://gyazo.com/780b5d8

null 71 Jan 8, 2023
The GhidraLookup plugin aims to help user lookup documentations of Win API functions.

GhidraLookup Plugin The GhidraLookup plugin aims to help user lookup documentations of Win API functions. Usage Right click on a Function in the Decom

Daniel Liu 8 Dec 23, 2022
Comparison between Java and Common Lisp solutions to a phone-encoding problem described by Prechelt

Prechelt Phone Number Encoding This project implements the phone number encoding described by Lutz Prechelt in his article for the COMMUNICATIONS OF T

Renato Athaydes 27 Nov 30, 2021
A Camunda Process Engine Plugin to execute Clojure Functions from Activities

camunda-clojure-plugin A Camunda Process Engine Plugin to execute Clojure Functions as Delegates Why do we need this? While Camunda is tightly integra

lambdaschmiede GmbH 11 Oct 11, 2022