The Skeleton Package is a template to get started with ProcessMaker Platform Packages
The skeleton package provides the necessary base to start developing a package for ProcessMaker Platform. Because ProcessMaker is built with Laravel, this is essentially a skeleton package for Laravel, with some modifications to ease development within the ProcessMaker Platform.
Change the package name (default is package skeleton) throughout the package to whatever name you would like:
Make sure composer and any dependencies are installed correctly:
In order to install your package in ProcessMaker, here are the step-by-step instructions.
Don't forget to replace the name you changes above when executing the commands below. They use the default name of package-skeleton
but should be replaced with what you changed the name to.
Require the package with Composer and thereby adding it to the composer.json file as a dependency of the application:
The installation code is located within Laravels artisan console commands. You can find additional details about it here: Artisan Docs
Navigate to the admin menu in your ProcessMaker Platform instance.
You should see your new menu item "Package Skeleton" or whatever you named your package, in the left sidebar.
Note: it is up to the developer to add any necessary code or proceedures to the install and uninstall commands. These can include adding and removing tables in the database, setting or removing api keys etc
Use php artisan package-skeleton:uninstall
to uninstall the package.
Use composer remove processmaker/package-skeleton
to remove the package completely.
​
Learn how to develop a custom package for ProcessMaker Platform to extend its functionality.
Extend ProcessMaker's functionality with custom functions and/or integrations with third-party services by developing your own .
The following are required or assumed to successfully create a package for ProcessMaker Platform:
You are a developer that is comfortable performing command-line operations. This is an advanced development topic.
You are comfortable and knowledgeable about . See .
ProcessMaker Platform is installed on your local computer.
PHP version 7 or later.
Learn how to develop a custom package for ProcessMaker Platform to extend its functionality.
Extend ProcessMaker's functionality with custom functions and/or integrations with third-party services by developing your own package.
The following are required or assumed to successfully create a package for ProcessMaker Platform:
Requirement | Function |
---|---|
First, let's start by creating a sibling directory to your ProcessMaker Platform installation folder. This example names the new directory processmaker-plugins.
For example, if your ProcessMaker installation is located at /opt/processmaker
, you can create the processmaker-plugins
directory at /opt/processmaker-plugins.
Clone and follow the instructions for setting up the package-skeleton template from our GitHub repository into your processmaker-plugins
directory.
Then edit your packages composer.json
file, similar to the below:
Next, locate the the composer.json
file for your ProcessMaker application (not to be confused with your packages composer.json file).
You can find the applications main composer.json
file at the root of the ProcessMaker application, assuming you are following along, it would be located at /opt/processmaker/composer.json
Now we need to add a reference to your package in the repositories
block of the composer.json
in order for the application to know of it's existence.
There are still a few things that will need to be fixed by hand:
You will need to rename your core controller from PackageSkeletonController.php
to your package's name (e.g. MyFirstPackageController.php
Located here, assuming you are following along: /opt/processmaker-plugins/my-first-package/src/Http/Controllers
)
Now, let's confirm that the controller name is right in addition to the filename.
Open your renamed controller and change the controller name, assuming you are following our conventions, to MyFirstPackageController
.
A good practice is to make sure your install and uninstall commands work well.
Assuming the package is located within /opt/processmaker-plugins/my-first-package
you will want to edit the file /opt/processmaker-plugins/my-first-package/routes/console.php
located inside your package to set up the artisan commands.
Depending on your preference, the install and uninstall can also be object oriented and done via classes, which would be located at src/Console/Commands/Install.php
and src/Console/Commands/Uninstall.php
, respectfully.
Perhaps you want to install a database table with your package for specific configuration needs.
We are assuming that you might have a seeder class named MyFirstPackageSeeder
that would be responsible for seeding the database with your table and data.
An example of an uninstall command might be to delete your packages assets when uninstalling.
All artisan commands MUST be run within the ProcessMaker application root directory. E.g. /opt/processmaker
To execute the install command, you would then run this from your terminal:
To execute the uninstall command, you would then run this from your terminal:
You may want to additionally execute the following lines to completely eliminate the package from the environment:
If you are doing any kind of UI related work or sometimes even other backend work that you need to include npm modules, here is how you can go about it.
Make sure to add all your configuration and dependencies within your packages package.json
, located in the root directory of your package (/opt/processmaker-plugins/my-first-package
if you have been following along).
Then run your npm commands:
Finally, the service provider class is what contains the instructions that laravel will execute when your package is loaded.
Here is an example of what can be contained inside a service provider class, specifically within the boot method:
This can also be used in the install and uninstall commands above.
Working programming knowledge
Access to ProcessMaker Platform
CLI access to a ProcessMaker instance with super user privileges. Typically, this is done in a local development environment.