Creating own activitySpec

What’s the exact steps to add my own activity to the platform?

I have a test react js app. The documentation only shows:

activity_spec = LAMP.ActivitySpec() # ActivitySpec |

A react.js app also consist of numerous files and assets.
Is there not a step by step document on getting this to the LAMP platform?
I would be glad to help add this to the documentation but first need to be able to this own my own first.

1 Like

@jtouthang This is a great question! We have rudimentary documentation on this available here.

If you’re making your new activity as a React app, you’ll need to bundle it all into a single HTML file and base64-encode it. Here’s the script we use for that, and here’s the whole CI/CD pipeline for all our in-house activities. That repository also contains all the activity source code.

Once you’ve done this and have a large base64 string, create a new ActivitySpec with the id set to a fully qualified reverse DNS name (i.e. org.jtouthang.my_new_activity or so) and the executable field set to the string from earlier. The settings and data fields are JSON Schema documents that describe how the clinician configuration page looks and what the output data looks like as well.

To see how the dashboard loads the activity, see this component, and to see how the JSON Schema Form is set up for our in-house activities, see this file.

While this feature is old, the extensibility implementation is very new and still a little rough around the edges. If you need any assistance with this, I’d be glad to help and provide more development insight on GitHub!

2 Likes

Thanks this is very helpful.

However, I still don’t see it after clicking the +Add button.

In the activity_spec table in couch db Here’'s what my document contents are:

{
  "_id": "org.laureateinstitute.test",
  "_rev": "1-f0730beaa31719cefe13befeaf5f282a",
  "help_contents": null,
  "script_contents": null,
  "static_data_schema": {},
  "temporal_slice_schema": {},
  "settings_schema": {},
  "category": null,
  "executable": "https://raw.githubusercontent.com/toujames/react-test/main/dist.html.b64"
}

@jtouthang Are you using the latest version of the dashboard and server? If so, can you share a screenshot and describe what you’re seeing/expecting in this GitHub issue? Thanks!

Will do, continuing this starting from this post.

1 Like