[id='_chap_deploying_projects']
= Deploying and Managing Projects
:context: chap-deploying-and-managing

After you have created a decision service with your process definition and relevant resources, you must ensure that the service is packaged with the proper GAV settings and then deploy it to the process engine.

After it is deployed, you can create process instances based on the deployed resources.

include::service-packaging-con.adoc[leveloffset=+1]

include::service-gav-setting-proc.adoc[leveloffset=+2]

include::project-duplicate-GAV-con.adoc[leveloffset=+3]

include::project-duplicate-GAV-manage-proc.adoc[leveloffset=+3]

include::service-deploying-con.adoc[leveloffset=+1]

include::central-using-deployment.adoc[leveloffset=+2]

include::service-build-deploy-proc.adoc[leveloffset=+3]

include::service-deploy-manage-central-proc.adoc[leveloffset=+3]

include::kieserver-configure-central-proc.adoc[leveloffset=+3]

include::maven-deployment.adoc[leveloffset=+2]

include::central-configure-maven-proc.adoc[leveloffset=+3]

include::kieserver-configure-runservice-proc.adoc[leveloffset=+3]

ifdef::PAM[]
== Editing Container Aliases Through {CENTRAL}

You can set container aliases when creating containers in the Intelligent Process Server. If you do not provide an alias, the `artifactId` of the project is set as alias by default.

.Prerequisite
* Red Hat JBoss EAP 7 is installed.
* Intelligent Process Server is connected to {CENTRAL}.
* Intelligent Process Server is registered in the server template as a server instance.

To edit the alias value before building your project in {CENTRAL}:

. In {CENTRAL}, select *Menu* -> *Design* -> *Projects*.
. In the *Projects* perspective, select a project.
. On the title bar, click *Build & Deploy*.
+
The *Build & Deploy* window opens with the *Container id* and *Container Alias* fields populated.
. Edit the values of the properties on the *Build & Deploy* window as required then click *Ok*.
. Click *Menu* → *DevOps* -> *Execution Servers*.
. Select your container name listed under *KIE CONTAINERS*.
. In the Status section, click the corresponding link for a given server. A log in window opens.
. Enter the user name and password for the selected server, then click *OK*.
+
A response in xml format opens. You can expand the Response section of the xml file to view the server response.
+
For more information on container aliases, see the http://ccs-jenkins.gsslab.brq.redhat.com:8080/view/Topic%20branches%20-%20BPMS/job/doc-BPMS-Development_Guide-branch-BXMSDOC-1331/lastSuccessfulBuild/artifact/index.html#container_aliases[Container Aliases] section of the _{DEVELOPMENT_GUIDE}_.
endif::PAM[]


== Manage

The following sections describe the features provided by the options available under *Menu* → *Manage* in {CENTRAL}.


=== Process Definitions

After you have created, configured, and deployed your project comprising your business processes, you can view the list of all the process definitions in *Menu* → *Manage* → *Process Definitions*.
The process definition view contains two main sections:

* Process Definition Lists
* Process Definition Details

The process definition list shows all the available process definitions that are deployed into the platform. If you click on any of the process definition listed in the Process Definitions List, the corresponding Process Definition details displays information about the process definition such as if there is a sub-process associated with it, or how many users and groups exist in the process definition.
In the Process Definition details section, you can navigate to *Options* -> *View Process Instances* to view associated process instances.

[id='_sect_process_instances']
=== Process Instances

You can create new process instances from the *Process Definition List*, from the *Process Definition Detail* view or from the *Process Instance* view. When you create a new Process Instance, a new window opens that requires you to provide information required by the process to be started. After you provide the required information and click *Submit*, the instance is created and the details of the process instance are displayed in *Process Instance Details* on the right.

You can further manage the instance during runtime, monitor its execution, and work with the tasks the instance produces for users with the proper roles assigned.

Additionally, {CENTRAL} enables you to easily sort and filter a list of tasks for any given process. You can create custom filters that enable you to define queries by user, business attributes (such as amount, customer segmentation), Process ID, correlation key, and so on.

You can view the list of all the running process instances in the Process Instance List under *Menu* -> *Manage* -> *Process Instances*.
The process instances view comprises two main sections:

* Process Instance Lists
* Process Instance Details

The process instance list displays the process instances. In this view, you can customize which columns  are displayed, then number of rows displayed per page, the name of the tabs, and the title description.
The views are available as tabs. When you click a tab, the associated parameters are applied to the data grid and the corresponding process instances are listed. You can remove the default tabs and add your own with the required filter criteria.
The Process Instances view also has features such as auto refresh and restore default views. Auto refresh enables you to define how frequently the data grid refreshes. You can select a different value (1, 5 or 10 minutes), or disable this feature by clicking the *Disable* button:

.Features in the Process Instances List View
image::Process_Instances_Features.png[Features in the Process Instances List View]


Each row in the process instance list represents a running process instance from a particular process definition.
Each execution is differentiated from all the others by the internal state of the information that the process is manipulating.
In order to view this information, you can click on any one of the process instances and view the corresponding details in the *Process Instance Details* section.
The *Process Instance Details* provides several tabs with the runtime information related to the process.

* The *Instance Details* tab: This gives you a quick overview about what is going on inside the process. It displays the current state of the instance and the current activity that is being executed.
* The *Process Variables* tab: This displays all the process variables that are being manipulated by the instance, with the exception of the variables that contain documents. You can move the mouse pointer over the *Value* field to view a full value of the process variable. Additionally, you can edit the process variable value and view its history.
* The *Documents* tab: This displays process documents if the process contains a variable of the type *org.jbpm.Document*. This enables easy access, download, and manipulation of the attached documents. You can not attach a new document to currently running instances using this view, but it can be achieved by Human task form in the tasks page.
* The *Logs* tab: This displays business and technical logs for the respective end users. In order to track a process through the logs, you can also open the Process Model that shows the completed activies in grey and the current activities highlighted in red.

ifdef::PAM[]
For information on user credentials and conditions to be met to access Intelligent Process Server runtime data, see the {URL_ADMIN_GUIDE}#accessing_runtime_data_from_business_central[Accessing Runtime Data from {CENTRAL}] section of the _{ADMIN_GUIDE}_.
endif::PAM[]

==== Searching Process Instances by Partial Correlation Key


To create a filter to search by correlation key or partial correlation key, do the following:

. On the top menu of the {CENTRAL}, go to *Menu* -> *Manage* -> *Process Instances*.
. In the list on the *Process Instances* tab, click image:plus_icon.png[] .
+
The *New Process Instance List* dialog box opens.
. In the *New Process Instance List* dialog box:
+
.. Provide the name and description for your search process instance list in the *Labels* tab.
.. Click the *Filter* tab to create new query filter.
+
... Click *Add New*.
... From the list of filter values, select *CORRELATIONKEY*. If you want to create a search filter using partial correlationKey, select the *like* query operator and provide the value as `partial-correlation-key%` where `partial-correlation-key` is the value you are searching for.
... Click *Ok*.

+
A new tab is created that displays your custom process instance list.


==== Searching Process Instances Based on Business Data


You can add process variables as columns in the process instance list in order to enable flexible filtering of definitions based on business data.
To achieve this, do the following:

. On the top menu of the {CENTRAL}, go to *Menu* -> *Manage* -> *Process Instances*.
. In the list on the *Process Instances* tab, click image:plus_icon.png[]. The *New Process Instance List* dialog box opens.
. In the *New Process Instance List* dialog box, perform the following:
+
.. Provide the name and description for your search process instance list in the *Labels* tab.
.. Add a new query filter in the *Filter* tab:
+
... Click *Add New*.
... From the list of filter values, select *processId* and *equalsTo*.
... Provide a valid `processId` value and click *Ok*.

+
A new tab is created that displays your custom process instance list in a  tabular form.
This new tab provides process instance variables (business data) as selectable columns.
You can view the variables corresponding to each process instance in the table by enabling these columns, which are disabled by default.


=== Creating a New Process Instance List


To create a custom process instance list, do the following:

. On the top menu of the {CENTRAL}, go to *Menu* -> *Manage* -> *Process Instances*.
. In the list on the *Process Instances* tab, click the image:plus_icon.png[] button.
+
The following *New Process Instance List*
dialog box opens:
+

.New Process Instance List
image::New_Process_Instance_List.png[New Process Instance List]
. In the *New Process Instance List* dialog box:
+
.. Provide the name and description for your process instance list in the *Labels* tab.
.. Click the *Filter* tab to create new query filter.
+
... Click *Add New*.
... From the list of filter values, select the appropriate filter condition and its value. You can add more filters by clicking *Add New*.
... Once you have specified all your filter conditions,	click *Ok*.

+
A new tab is created that displays your custom process instance list.

ifdef::PAM[]
[id='sect-process-instance-filtering']
=== Advanced Search Filtering of Process Instances

Administrators and process administrators can search for process instances using the *Search* tab on the *Process Instances* page.

Access the *Process Instances* list by clicking *Menu* -> *Manage* -> *Process Instances*.

.Filtering Process Instances - Default View
image::ProcessInstancesSearchSmall.png[Filtering Process Instances - Default View]

Process instances can be filtered on the following attributes:

*Id*:: Filter by process instance ID.
+
Input: `Numeric`

*Initiator*:: Filter by the user ID of the process instance initiator.
+
The user ID is a unique value, and depends on the ID management system.
+
Input: `String`

*Correlation key*:: Filter by correlation key. For more information about correlation keys, see the {URL_DEVELOPMENT_GUIDE}[{DEVELOPMENT_GUIDE}].
+
Input: `String`

*Description*:: Filter by process instance description.
+
Input: `String`

State::
Filter by different states. Only one state filter can be applied to the search results at a time. Selecting a different state overwrites the current state filter. Removing the state filter displays all processes, regardless of state.
+
*Active*, *Completed*, and *Aborted* tabs in the *Process Instances* page display a list of all process instances with these states, however the filtering cannot be performed on these tabs. The following filter states are available:
+
** Active
** Aborted
** Completed
** Pending
** Suspended

Errors::
Filter by process instances with or without errors.

Name:: Filter by project name.

Date and time filtering::
+
Start Date::: When the process was started.
Last Update::: When the process was updated or modified.

:: Each of these filters have the following quick filter options:

** Last Hour
** Today
** Last 24 Hours
** Last 7 Days
** Last 30 Days
** Custom
+
Selecting *Custom* date and time filtering opens a calendar tool for selecting a date and time range.
+
.Process Instances Search by Date Range
image::DateRangeSearch.png[Search by Date Range]

For more information about advanced search filtering, see <<chap-process-admin-quick-filtering>>.

endif::PAM[]

[id='_aborting_a_process_instance']
=== Aborting a Process instance


You can abort a running Process instance either using the provided API or from the {CENTRAL}.

[float]
==== Aborting a Process instance using API


To abort a Process instance using the Kie Session API, use the `void abortProcessInstance(long processInstanceId)` call on the parent Kie Session.

[float]
==== Aborting a Process instance from the {CENTRAL}


To abort a Process instance from the {CENTRAL}, do the following:

. On the top menu of the {CENTRAL}, go to *Menu* -> *Manage* -> *Process Instances*.
. In the list on the *Process Instances* tab, locate the required Process instance and click the *Abort* button in the instance row.

[id='_signaling_a_process_instance']
=== Signaling Process Instance

You can signal a running process instance using either API or {CENTRAL}. For further information about signals, signaling external deployment, catching and processing signals, and more, see <<_sect_collaboration_mechanisms>>.

[float]
==== Signaling Process Instance Using API

To signal a process instance using the KIE Session API, use the `void signalEvent(String type, Object event)` call on the parent Kie Session.
The call triggers all active signal event nodes waiting for that event type in the KIE Session.
The runtime strategy determines the number of processes which receive the signal.

If you need to signal a specific process instance, use `void signalEvent(String type, Object event, long processInstanceId)`.

[NOTE]
====
If you use the `Throwing Intermediate` event of type ``Signal``, the execution engine calls `void signalEvent(String type, Object event)`.

If you do not want the signal to be delivered to all the listening processes, replace the `Throwing Intermediate` event with a ``Script Task``:

[source,java]
----
kcontext.getKieRuntime().signalEvent("signalRefId", data, processInstanceId);
----
====

[float]
==== Signaling Process Instance from {CENTRAL}

To signal a process instance from {CENTRAL}, do the following:

. Log in to {CENTRAL}.
. Click *Menu* -> *Manage* -> *Process Instances*.
. Locate the required process instance and click *Signal* in the instance row.
. Fill the following fields:
* *Signal Name*: corresponds to the `SignalRef` or `MessageRef` attributes of the signal. This field is required.
+
NOTE: You can also send a `Message` event to the process. To do so, add the `Message-` prefix in front of the `MessageRef` value.
* *Signal Data*: corresponds to data accompanying the signal. This field is optional.

NOTE: When using the {CENTRAL} user interface, you may signal only Signal intermediate catch events.



[id='_sect_user_tasks']
== Task Management


The following sections describe the features provided by the options available from *Menu* -> *Track* -> *Task Lists*.

=== Tasks List


A User Task represents a piece of work the given user can claim and perform.
User Tasks can be handled within the *Tasks* page of the {CENTRAL}: the view displays the Task List for the given user.
You can think about it as a to-do item.
The User Task appears in your list because the User Task element generated the User Task.

A User Task can be assigned to a particular actor, multiple actors, or to a group of actors.
If assigned to multiple actors or a group of actors, it is visible in the Task Lists of all the actors and any of the possible actors can claim the task and execute it.
The moment the Task is claimed by one actor, it disappears from the Task List of other actors.

[float]
==== Task Client

User Tasks are displayed in the Tasks List page. To display the Tasks Lists page, select *Menu* -> *Track* -> *Task Lists*.
You can filter the tasks based on their status using the following tabs:

.Task Lists Tabs
image::Task_Lists_Tabs.png[Task Lists Tabs]

* *Active*: Displays all the active tasks that you can work on. This includes personal and group tasks.
* *Personal*: Displays all your personal tasks.
* *Group*: Displays all the group tasks that need to be claimed by you in order to start working on them.
* *All*: Displays all the tasks. This also includes completed tasks but not the ones that belongs to a process that is already finished.

In addition to these, you can create custom filters to filter tasks based on the query parameters you define.
For further information about custom tasks filters, see <<_creating_custom_tasks_filters>>.

The *Tasks List* view is divided into two sections, *Task List* and *Task Details*. You can access the *Task Details* by clicking on a task row. You can modify the details (such the Due Date, the Priority or the task description) associated with a task.
The Task Details section comprises the following tabs:

* *Work*: Displays basic details about the task and the task owner. You can click the *Claim* button to claim the task. To undo the claim process, click the *Release* button.
* *Details*: Displays information such as task description, status, and due date.
* *Process Context*: If the task is associated with a process, the information about it is shown here. You can also navigate to process instance details from here.
* *Assignments*: Displays the current owner of the task and allows you to delegate the task to another person or group.
* *Comments*: Displays comments added by task user(s). It allows you to delete an existing comment and add a new comment.
* *Logs*: Displays task logs containing task life cycle events (such as task started, claimed, completed), updates made to task fields (such as task due date and priority).



[id='_creating_custom_tasks_filters']
=== Creating Custom Tasks Filters


It is possible to create a custom task filter based on a provided query.
The newly created filter is then added as a tab to the Tasks List.

The following procedure shows how to create a custom filter which allows you to view a list of tasks with a specified name.

.Procedure: Filtering Tasks by Name
. In {CENTRAL}, select *Menu* -> *Track* -> *Task Lists*
. Click the image:plus-button.png[] button on the right side of the Tasks Lists tabs.
+
The *New filtered list* pop-up window is displayed.
+
image::new-filtered-list.png[TheNew filtered list pop-up window.]
. Fill in the *Name* (this is the label of the new Tasks Lists tab) and click *Filter*.
. Click *Add New*.
. In the *Select column* drop-down menu, choose *NAME*.
+
The content of the drop-down menu changes to ``NAME != value1``.
. Click on the drop-down menu again and choose *equals to*.
+
The content of the drop-down menu changes to ``NAME = value1``.
. Rewrite the value of the text field to the name of the task you want to filter. Note that the name must match the value defined in the *Process Modelling* view of a business process. See the following screenshot:
+
image::task-name.png[]
. Click *Ok*.
+
image::new-fl-final.png[]
+
After the filter with a specified restriction is applied, the set of configurable columns is based on the specific custom task filter and contains the following column options:
+
image::in_name-column-new.png[]

ifdef::PAM[]

[id='sect-task-filtering']
=== Advanced Search Filtering of Tasks

Task filtering includes the same filter attributes whether you are searching the *Task List* for users, or the *Task Administration List* for process administrators and administrators.

.Filtering Tasks - Default View
image::TaskAdminSearchSmall.png[Filtering Tasks - Default View]

* Access the *Task List* perspective by selecting *Menu* -> *Track* -> *Task Lists*. It displays a list of your related tasks.
* Access the *Tasks Administration List* by clicking *Menu* -> *Manage* -> *Tasks Administration*. It provides a full list of tasks across all processes.
+
The *Task Administration List* is only available to administrators and process administrators.

Tasks can be filtered on the following attributes:

Id:: Filter by process instance ID.
+
Input: `Numeric`

Task:: Filter by task name.
+
Input: `String`

Correlation key:: Filter by correlation key. For more information about correlation keys, see the {URL_DEVELOPMENT_GUIDE}[{DEVELOPMENT_GUIDE}].
+
Input: `String`

Actual Owner:: Filter by the task owner.
+
The actual owner refers to the user responsible for executing the task. The search is based on  user ID, which is a unique value and depends on the ID management system.
+
Input: `String`

Process Instance Description:: Filter by process instance description.
+
Input: `String`

Status:: Filter by task status. Only one status filter can be applied to the search results at a time. Selecting a different status overwrites the current status filter. Removing the status filter displays all processes, regardless of status.
+
In the *Task List* page, *Active*, *Personal*, *Group*, and *All* tabs display a list of all tasks with these statuses, however the filtering cannot be performed on these tabs. The following filter states are available:
+
** Completed
** Created
** Error
** Exited
** Failed
** InProgress
** Obsolete
** Ready
** Reserved
** Suspended

Process Name:: Filter by process name.

Created On:: Filtering by date or time.
+
This filter has the following quick filter options:

** Last Hour
** Today
** Last 24 Hours
** Last 7 Days
** Last 30 Days
** Custom
+
Selecting *Custom* date and time filtering opens a calendar tool for selecting a date and time range.
+
.Search by Date
image::DateRangeSearch.png[Search by Date Range]

For more information about advanced search filtering, see <<chap-process-admin-quick-filtering>>.

endif::PAM[]

=== Task Variables as Expressions


You can refer and use the task variables in task properties as soon as you create a task.
For example, once your task has been created, you can define a task name that refers to a [var]``taskId``.
Task variables are resolved at both task creation time and notification time, unlike process variables, which  are resolved only at task creation time.
The ability of using task variables while creating tasks minimizes your Java code, such as calling {PRODUCT} APIs.

Task variables are available as task instances and you can get access to task information using the following expression:

[source,java]
----
${task.id}
----


You can use this expression in data input of user task from within the process definition.

For example, the following expression can be used for accessing the [var]``processInstanceId`` variable:

[source,java]
----
${task.taskData.processInstanceId}
----
