plynx-team/plynx

Can template operations be grouped

Opened this issue · 1 comments

I am in the process of creating some python-code-operations which we will store in source control to deploy for customers.

Curious if template operations can be grouped.

image

querying
db.templates.find({}, {title: 1})
I only get operations that exist in 1 of the three given tabs.

image

> use plynx
switched to db plynx
> db.templates.find({"node_status": "READY"}, {title: 1})
{ "_id" : ObjectId("6333a4fc2325aa7c29fd270a"), "title" : "ac_api" }
{ "_id" : ObjectId("6333a4fc2325aa7c29fd270d"), "title" : "querydb" }
{ "_id" : ObjectId("6333a5102325aa7c29fd279b"), "title" : "kiwisaver_communication" }
{ "_id" : ObjectId("6334b25db9ebaa918a8a3d31"), "title" : "sleep" }
{ "_id" : ObjectId("6345d2afd2334e02f7a2246a"), "title" : "insertdb" }
{ "_id" : ObjectId("634c6c0a524e8fd66ffe7149"), "title" : "Test AC PL" }
{ "_id" : ObjectId("634c7246524e8fd66ffe7152"), "title" : "Testing AC Payload" }
{ "_id" : ObjectId("634c814f524e8fd66ffe7217"), "title" : "Test Real AC PL" }
{ "_id" : ObjectId("6371b779afd5d87412b5499b"), "title" : "multi_kiwisaver_communication_2" }
{ "_id" : ObjectId("637302a5afd5d87412b54d0d"), "title" : "Adobe AC Remap With Optional CRS" }
{ "_id" : ObjectId("637af94cafd5d87412b55217"), "title" : "map_comms_2" }
{ "_id" : ObjectId("637afaf9afd5d87412b55232"), "title" : "kiwisaver_comms_2" }
{ "_id" : ObjectId("638d0b04afd5d87412b55851"), "title" : "Map SFH5" }
{ "_id" : ObjectId("638fc416afd5d87412b559b3"), "title" : "env" }
{ "_id" : ObjectId("638fcd28afd5d87412b559bd"), "title" : "files2" }
{ "_id" : ObjectId("638fce44afd5d87412b559c1"), "title" : "readcfg" }
{ "_id" : ObjectId("638feba2afd5d87412b559ce"), "title" : "Make Payload2" }
{ "_id" : ObjectId("638ff3dbafd5d87412b559fd"), "title" : "Convert Contribtution Date" }
{ "_id" : ObjectId("638ffbfbafd5d87412b55a08"), "title" : "Produce Contribtution Rate Change" }
{ "_id" : ObjectId("638ffc5aafd5d87412b55a0d"), "title" : "test" }
Type "it" for more
> it
{ "_id" : ObjectId("638fff639c608d8a08f5669c"), "title" : "export" }
{ "_id" : ObjectId("638fff639c608d8a08f566a1"), "title" : "push" }
{ "_id" : ObjectId("6390623ed1eb85ceecdd0ac2"), "title" : "readcfg2" }
{ "_id" : ObjectId("63906266d1eb85ceecdd0ac3"), "title" : "Push" }
{ "_id" : ObjectId("63906316d1eb85ceecdd0ac8"), "title" : "cfg3" }
{ "_id" : ObjectId("63906350d1eb85ceecdd0acd"), "title" : "Export" }
{ "_id" : ObjectId("63906495d1eb85ceecdd0acf"), "title" : "Success Report Values" }
{ "_id" : ObjectId("63910576d1eb85ceecdd0aea"), "title" : "Success History Query" }
{ "_id" : ObjectId("63910971d1eb85ceecdd0af2"), "title" : "Electrify Success History Query" }
{ "_id" : ObjectId("63911200d1eb85ceecdd0b0f"), "title" : "Electrify Success Report Limit 1" }
{ "_id" : ObjectId("639123c6d1eb85ceecdd0b1e"), "title" : "Push From History" }
{ "_id" : ObjectId("639b84f9fced9352472316d1"), "title" : "import json test" }
{ "_id" : ObjectId("639bb0a06870bcbbe79542a6"), "title" : "map_kiwisaver_communication" }

Can I group operations stored in templates, or should operations exist somewhere else?

Hi @samN3Hub,

Seems like you are using the hubs based on the ones in the default configuration. I will rely on them as Static and Database Hubs.

In case of the Database Hub, yes it is using the templates defined in the database under db.templates collection. Unfortunately there is no standard way to group them. It's mostly because of the complexity and other priorities. Right now you can only use the database as a list of Operations.

In case if the Static Hub, I think this is what you might be looking for! Don't be confused with the word Static, as it means just the fact that you may not modify them through PLynx UI.
The Operations in the Static Hub are defined as the code and comply to all of the source control rules as you mentioned. The Operations in the Static Hub are NOT presented in the database.

Please take a look at the code with those operations in the demo https://github.com/plynx-team/plynx-deploy/blob/master/plynx_deploy/cv/transform.py . In this file a list COLLECTION is a list of Groups, and each of them contains the Operations.