Giter Club home page Giter Club logo

Comments (7)

jbirddog avatar jbirddog commented on August 12, 2024

Granted this is not the direct answer to your the issue, but traditionally speaking if you want to communicate with an external system you'd use a ServiceTask. In SpiffArena ServiceTasks are driven by the concept of a Connector Proxy which is some externally hosted system that conforms to a protocol that provides information about what communication channels are supported and executes those communication requests. Each connector proxy can have several commands. For this particular example it sounds like our http/{Get,Post} connectors may work. If not a custom connector could be written. For some examples we have:

  1. Connector proxy demo
  2. Example http connector

These connectors can range from very generic (http/GetRequest) to hyper specific (xero/CreateInvoice) depending on the use cases.

from spiff-arena.

jbirddog avatar jbirddog commented on August 12, 2024

Also here is a sample bpmn file that uses service tasks, script tasks and has some unit tests.

from spiff-arena.

ManuelLevi avatar ManuelLevi commented on August 12, 2024
  1. My use-case: I'm using requests to actively check if an API is working correctly. This system is read-only, and I have no control over it. Another simple use-case is using a simple API to get a random number from https://www.random.org/clients/http/api/.

  2. On connectors: Do you have any documentation on how the connectors work? I've read what's available, but I wouldn't know where to start. It also seems a bit overkill to what I want to do.

  3. If I was going to make changes to my own Fork of spiff-arena, where would I have to make changes so importing is allowed? I have tried searching this repo for "Import not allowed", but couldn't find any reference.

from spiff-arena.

jbirddog avatar jbirddog commented on August 12, 2024

The documentation is a bit light in this area, but we do have a walk through for deploying a connector proxy as an aws lambda function - https://github.com/jbirddog/connector-proxy-lambda-demo/blob/main/deploy-integrate.md

If that route does not appeal to you then any other deployment would work. Your first use case seems to align well with the http/GetRequest.

If you want to continue to use a script task and import requests, @burnettk opened a pr to allow disabling the restricted python set up, which would allow you to import from within script tasks.

from spiff-arena.

burnettk avatar burnettk commented on August 12, 2024

@ManuelLevi yeah, definitely check out the hot doc @jbirddog linked and especially the section on integrating with SpiffArena for more details about how to interact with a connector proxy that is deployed. i think you have tried out the docker-compose.yml from https://www.spiffworkflow.org/posts/articles/get_started ? if so, there will already be a connector-proxy container running locally and you should be able to use a service task and configure it like this:

image

when you run the process, it would get task data like this (note that the response variable, respo, gets populated with the response body of the http call:

image

I'm going to go ahead and close this issue, but feel free to re-open it or otherwise get in touch with any additional questions. 👍

from spiff-arena.

ManuelLevi avatar ManuelLevi commented on August 12, 2024

This looks exactly like what I should be using, thank you so much @jbirddog and @burnettk !

from spiff-arena.

burnettk avatar burnettk commented on August 12, 2024

@ManuelLevi awesome, did you end up using the service task / connector or the unrestricted python script environment?

from spiff-arena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.