douglascayers / sfdc-process-invocable

Launch Invocable Processes from Flow or Apex on-demand.
https://douglascayers.com/2016/10/31/how-to-invoke-process-builder-from-flow/
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Declarative API Project #2

Open danhowellnz opened 7 years ago

danhowellnz commented 7 years ago

Hi Doug,

As always I love your work. I have started my own branch looking at creating a generically invocable API. https://github.com/danhowellnz/Declarative-Api-Project

I haven't done very much on it as I'm not really an API man. I used your structure, batching and test classes. I would love to touch base to think how a generic API tool could be built.

douglascayers commented 7 years ago

Hi @danhowellnz,

Sorry for just now getting back to you. I've been preparing and traveling for Midwest Dreamin 2017.

Thanks for the kind feedback, I really appreciate that!

Your idea sounds like a fun and ambitious project =)

When I'm planning an API, I take some time to brainstorm the various data inputs and outputs I want to support. The more generic (to a point) means I can support new data sources, hopefully, without too much refactoring of my code base.

I'll try to take a look at your project soon and share more comments. One thing I notice just from the screent shot in your README is that it's taking in multiple JSON LINE # inputs. Any reason for this and not a single text input variable?

Good luck, and let me know if you have any questions!

Doug

danhowellnz commented 7 years ago

I'm by now way an API guy. Very new to it. Just trying to build generic tools for the community rather than restarting each time.

One hurdle is that APIs take a way of thinking and process understanding. So to simplify that is a bit tricky.

I started with a single input and I'm playing with ideas. The biggest detriment is that you can't make Multi line formulas very easily (unless I'm missing something) and they become unreadable when trying to add the quotes around quotes ECT.

Any thoughts on passing the Json? I tried using some merge fields that be used.

The other challenge I haven't looked at yet is passing generic sobject collections from visual workflow. I'm wondering if passing a soql query is easier and more robust. I just want to lay it out so it's really easy for admins to figure out. I suppose it needs a visual force page to build the query for them (but that's a lot of work for now)

douglascayers commented 7 years ago

Hi @danhowellnz,

Kudos for jumping in and helping the community by developing reusable tools!

On the topic of declarative APIs, keep an eye out for what Salesforce is doing in this space. They've announced a beta for External Services that will allow admins to call out to web services without having to write any code or mess with JSON. Not to discourage your vision, though you may want to get entrenched here and see how you can expand on this initiative.

Regarding passing generic sobject collections from visual workflow, in which direction are you referring? As input or output variables with the flow?

Doug

danhowellnz commented 7 years ago

Thanks! I can't wait for this to be standard functionality.

In looking at doing a fast lookup in a flow and then pass that sobject connection variable to apex.

The sobject variables in flows are never generic so the screens don't let you select generic variables. Any ideas?