[id='custom-tasks-deploying-custom-tasks-proc-{context}']
= Deploying custom tasks

Work item handlers, as custom code, are created outside of {PRODUCT}. To use the code in your custom task, the code must be deployed to the server. Work item handler projects must be Java JAR files that can be placed into a Maven repository.

In {PRODUCT} you can deploy custom tasks using two methods:

* Within a {CENTRAL} custom task repository.
ifdef::DM,PAM[]
For more information, see {URL_DEVELOPING_PROCESS_SERVICES}#manage-service-tasks-proc_managing-and-monitoring-processes[_{MANAGING_PROCESSES}_].
endif::[]
* Outside of {CENTRAL}, you can manually copy the JAR files into the Maven repository.

== Using a {CENTRAL} custom task repository

You can enable, disable, and deploy custom tasks within a {CENTRAL} custom task repository.
ifdef::DM,PAM[]
For more information, see {URL_DEVELOPING_PROCESS_SERVICES}#manage-service-tasks-proc_managing-and-monitoring-processes[_Managing custom tasks in {CENTRAL}_].
endif::[]

== Uploading JAR Artifact to {CENTRAL}

You can upload the work item handler JAR to the {CENTRAL} Maven repository using {CENTRAL} admin settings.

.Procedure
. In {CENTRAL}, select the *Admin* icon in the top-right corner of the screen and select *Artifacts*.
. Click *Upload*.
. In the *Artifact Upload* window, click the *Choose File* icon.
. Navigate to the location of the work item handler JAR, select the file and click *Open*.
. In the pop-up dialog, click the *Upload* icon.
+
The artifact is uploaded and can now be viewed on the *Artifacts* page and referenced.

== Manually copying work item definitions to {CENTRAL} Maven repository

{CENTRAL} automatically creates or reuses the Maven repository folder. By default the location is based on the location of the user launched {EAP}. For example, the full default path would be `<startup location>/repositories/kie/global`. It is possible to replicate a standard Maven repository folder layout of `<groupId>/<artifactId>/<versionId>/` in this folder and copy work item handler JAR files to this location. For example:
----
<startup location>/repositories/kie/global/com/redhat/myworkitem/1.0.0-SNAPSHOT/myworkitems-1.0.0-SNAPSHOT.jar
----

Any artifacts copied in this fashion are available to {PRODUCT} without a server restart. Viewing the artifact in the {CENTRAL} *Artifacts* page requires clicking *Refresh*.
