project-flogo / contrib Goto Github PK
View Code? Open in Web Editor NEWCore Flogo activities, triggers and functions that are useful across the various event-driven action types.
License: BSD 3-Clause "New" or "Revised" License
Core Flogo activities, triggers and functions that are useful across the various event-driven action types.
License: BSD 3-Clause "New" or "Revised" License
Currently the rest trigger does not handle requests containing files. Should we add that feature in the main Rest trigger? Or should we have a different trigger to handle files ? @fm-tibco @mellistibco @abramvandergeest can you share your thoughts on this?
Currently, https://github.com/skothari-tibco/contrib/tree/rest_image/trigger/rest supports a single file. We can change it to handle multiple files.
Changes to the current trigger will include. Adding file
setting in handler settings. And the type of the content would be map[multipart.FileHeader]multipat.File
. We can also discuss on the format of output.
file
setting in the handler setting will be the key
which contains the files in the Http request.The Http request should of type multipart/form-data
The reason there is multipart.FileHeader
as a part of output because it contains the name, type and size of the file. Getting this information form the multipart.File
only would not be possible.
In Flogo, when we want to install a contribution (github.com/project-flogo/contrib/activity/log for instance) in an application we run:
flogo install github.com/project-flogo/contrib/activity/log
Currently, this command does a go get -u github.com/project-flogo/contrib/activity/log
(see https://github.com/project-flogo/cli/blob/99f31dabada136e9cddc2e5202d97011a7a315bc/util/mod.go#L80).
By design, go get
cannot fetch a specific revision (tag or branch), but only HEAD (master).
Hence we cannot do something like:
flogo install github.com/project-flogo/contrib/activity/[email protected]
Instead we could use go mod edit
in the flogo install
command instead of go get
:
go mod edit -require github.com/project-flogo/contrib/activity/[email protected]
as tried at https://github.com/square-it/cli/blob/1e044ca3c17e14913e3914700aa4210e55c4292d/util/mod.go#L82.
However this will lead to this error:
go: finding github.com/project-flogo/contrib/activity/log v0.9.0
go: errors parsing go.mod:
/workspaces/flogo/simple-app/src/go.mod:4: invalid module version "v0.9.0": missing github.com/project-flogo/contrib/activity/log/go.mod at revision 680ebf186e58
That's logic since the go.mod file for this contributions repository lives at github.com/project-flogo/contrib, not at github.com/project-flogo/contrib/activity/log
Using a more verbose commands such as:
flogo install github.com/project-flogo/[email protected] github.com/project-flogo/contrib/activity/log
flogo install -module github.com/project-flogo/[email protected] -contrib github.com/project-flogo/contrib/activity/log
the Flogo CLI could use the module import in go.mod and the contribution import path in imports.go.
another more compact representation allowing multiple contributions installation at once
flogo install github.com/project-flogo/[email protected]/activity/log github.com/project-flogo/[email protected]/activity/rest
If we don't want to modify the CLI behaviour, we can also require that any contribution must have its own go.mod file. For instance, go.mod for the github.com/project-flogo/contrib/activity/log activity would look like:
module github.com/project-flogo/contrib/activity/log
require (
...
)
Described in PR project-flogo/cli#32
Depends on PRs:
Will someone please merge the dependabot pull request to bump the version of golang.org/x/text to 0.3.7?
Consider adding more array functions.
Please add more if you think it is valuable.
WebUI decides if the activity is the last executable type of task based on the property return
set to true
in its descriptor JSON. With the new contribution installed into web ui, adding a Return activity to the flow is allowing the user to add further activities.
Below is the Rest Invoke Activity definition. I changed the key for security.
I am getting below error when I try to run it.
2019-11-27T16:14:26.909-0500 INFO [flogo.activity.log] - 404 -> {"Code":"404","Message":"Not found","Reference":"/currentconditions/v1?apikey=95df38db964c4236936b1e894ad2232f","Exception":null}
The same mapping is working fine when I use in logger and getting json logged.
Mapping: "=string.concat('{\"zipC\": \"', $flow.CityCode_Input, '\"}')"
Log Entry: 2019-11-27T16:14:26.722-0500 INFO [flogo.activity.log] - '{"zipC": "70604"}' - HostID [3758ec316bc59a057d4364336a20b3bc], HostName [Lambda_GET_WeatherLimit_POC], Activity [Log_Request]
{
"id": "rest_3",
"name": "AccuWeather_GET_RESTInvoke",
"description": "Invokes a REST Service",
"activity": {
"ref": "#rest",
"input": {
"pathParams": "=string.concat('{\"zipC\": \"', $flow.CityCode_Input, '\"}')",
"queryParams": "=string.concat('{\"apikey\": \"', 'N1KaG63pxFWtIQRcZuKX9', '\"}')"
},
"settings": {
"uri": "http://dataservice.accuweather.com/currentconditions/v1/:zipC?",
"method": "GET"
}
}
}
Building an app that include a CLI trigger fails with the following error:
Building executable [Name:ProcessStarter, OS:linux, Arch:amd64] for the TCI app with Id [fisqswzm7ch2k2qvg6mlx5wl3enago73]
› CLIBaseError: Build executable error: Build debugger engine binary build error [exit status 2], details # engine
› src/engine/shim_support.go:15:7: flogoJSON redeclared in this block
› src/engine/embeddedapp.go:10:7: other declaration of flogoJSON
› src/engine/shim_support.go:63:15: undefined: NewManagement
I am new to flogo and I started to use it with the Flogo Web UI.
I tried creating an application with a Receive HTTP Message Trigger and in the path definition I wrote the following:
/flightbooking/:class?firstName=first&lastName=last
When I test it through the browser, it seems like the path parameter is ignored and only the query parameters are considered.
The response I receive is the following:
{"Class":"","Cost":468,"DepartureDate":"02/03/2023","DeparturePoint":"PAR","Destination":"SFO","FirstName":"first","Id":533,"LastName":"last"}
But then I tried creating another Flow action in the same App, also with a Receive HTTP Message Trigger, but this time with the following path:
/hello/:name
And then the path parameter is not ignored, because I receive it in the response:
{"Hello":"Test"}
In both cases I am mapping the Trigger Output to the Flow input in the same way:
$.pathParams.class
$.pathParams.name
Can you help with this issue? Is there something that I need to be doing differently?
If you need more info on other parts of the flow, just let me know!
Couldn't get this working with the latest version of Flogo. The flow is not started.
flogo install github.com/project-flogo/trigger/cli
Error in installing 'github.com/project-flogo/trigger/cli'
Error installing contribution/dependency: go get github.com/project-flogo/trigger/cli@latest: module github.com/project-flogo/trigger/cli: git ls-remote -q origin in /Users/mmussett/src/go/pkg/mod/cache/vcs/d2184ee5c3f75ba69f657d9e271de453da32be2d5f29a09c6632ea84faa465e4: exit status 128:
remote: Repository not found.
fatal: repository 'https://github.com/project-flogo/trigger/' not found
Try to execute
fritz@ubuntu:~$ flogo install github.com/project-flogo/contrib/activity/log
Error validating project: not a valid flogo app project directory, missing 'src' diretory
Seems to be same for all addons.
datetime.formatDate("July 29, 2020", "Jan 2, 2006") but it always returns back with jan 29, 2020
.
I am trying to put the list of brokers and topics from environment variable with "$env [KAFKA_BROKER_URLS]" and when I run it I get the following error:
Failed to create engine: unable to create stage 'github.com/project-flogo/contrib/activity/kafka' : BrokerUrl [=$env[KAFKA_BROKER_URLS]] format invalid for reason: [BrokerUrl must be composed of sections like "host:port"]
Today, the varArgs
is function level field, take concat function as an example here:
{
"name": "concat",
"description": "concatenate a set of string",
"example": "string.concat(\"Hello\",' ', \"World\") => Hello World",
"varArgs": true,
"args": [
{
"name": "str",
"type": "string"
}
],
"return": {
"type": "string"
}
}
But actually the varArgs
should be an argument level fields. from go perspective, the varArgs
can be only the last argument and there still can be more different type arguments before that.
For concat case, it makes more sense only when the arguments more than 2. so change the descript to below seems more reasonable.
{
"name": "concat",
"description": "concatenate a set of string",
"example": "string.concat(\"Hello\",' ', \"World\") => Hello World",
"args": [
{
"name": "str",
"type": "string",
"required": true
},
{
"name": "str2",
"type": "string",
"required": true
},
{
"name": "str3",
"type": "string",
"varArgs": true
}
],
"return": {
"type": "string"
}
}
@fm-tibco @mellistibco Please give your thoughts.
contrib/activity/channel/descriptor.json
Line 16 in 9d5e983
contrib/activity/channel/metadata.go
Line 9 in 9d5e983
Descriptor json defines as result
:
"output": [
{
"name": "status",
"type": "int",
"description" : "The HTTP status code"
},
{
"name": "result",
"type": "any",
"description" : "The HTTP response data"
}
]
But runtime metadata define as data
type Output struct {
Status int `md:"status"` // The HTTP status code
Data interface{} `md:"data"` // The HTTP response data
}
Today the string.substring function takes the second and third argument as start and length but it should start and end.
The rest trigger's output includes pathParam, queryParams, content, headers but method (i.e. GET, PUT, POST, etc).
Http method is often a key information for a handler's action to process the request properly.
An example field should have the correct type, the string cannot assign to datatype as it is a type mismatch.
When trying to build my flogo project with github.com/project-flogo/contrib/activity/runaction
contribution installed, I get the following errror:
flogo build
Error building project: go: finding github.com/project-flogo/core/runner latest
C:\Users\ppaidi\goworkspace\pkg\mod\github.com\project-flogo\contrib\activity\[email protected]\activity.go:12:2: unknown import path "github.com/project-flogo/core/runner": cannot find module providing package github.com/project-flogo/core/runner
There are some HTTP functions not working which has NPE exception.
Such as:
we should add test cases for all functions
I would like to be able to access from Flogo to my REST HTTP response headers and also send them back to the client which initiate the application.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.