]> git.codecow.com Git - flowpex.git/commitdiff
Add README
authorChris Duncan <chris@flowpex.dev>
Sun, 23 Jun 2024 08:06:01 +0000 (01:06 -0700)
committerChris Duncan <chris@flowpex.dev>
Sun, 23 Jun 2024 08:06:01 +0000 (01:06 -0700)
README.md [new file with mode: 0644]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..d6f493c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,29 @@
+# Flowpex
+Invoke Apex in Flows
+
+## Objective
+The goal of Flowpex is straightforward: make as many Apex functions available in Flows as possible. This was initially inspired by the need to control Flow behavior based on the time zone of the running user; this is something that, at the time, required Apex to accomplish.
+
+## Design
+
+The library is a simple but large collection of [Invocable Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm). Each one correlates to an Apex namespace, class, and function.
+
+For example, to get the time zone of the current user in a Flow, add an Apex Action node that calls `flowpex__System_UserInfo_getTimeZone` and pass the Flow global variable `$User` as an argument.
+
+## Installation
+
+A variety of packages are available.
+1. Each namespaced Apex class is packaged separately so that features can be installed as needed.
+1. Each Apex namespace is packaged as a whole so that all classes can be installed at once.
+
+## Caveats
+
+* Since Invocable Methods must be static, all methods included in Flowpex that normally operate on an instance of a class will instead accept it as a parameter.
+* Due to the restrictions placed on inputs and outputs of Invocable Methods, not all arguments or return types are possible.
+  * This library includes some workarounds to allow certain data types that are otherwise inaccessible.
+
+### Example
+Consider the `flowpex__System_SObject_getSObjectType` Apex Action in a Flow.
+1. It will accept, as an argument, an instance of an sObject (i.e. an Account record).
+1. It will return the custom Apex-defined data type `flowpex__Schema_SObjectType`.
+1. The Apex-defined return type will consequently only consist of primitives, sObjects, and/or Apex-defined types.
\ No newline at end of file