Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Stardust/Knowledge Base/API/A first Look at the Stardust API"

m
m
Line 1: Line 1:
 
+
== Introduction  ==
  
 
This article will give you first taste of Eclipse Process Manager (EPM) API. The aim of this article is to explain the process of gaining the access to EPM API and explaining the available core service at large. I assume that you have already installed EPM modeler and have EPM runtime environment setup with simple process model deployed in it. If you haven't done this, please follow this documentation <link to come soon>.  
 
This article will give you first taste of Eclipse Process Manager (EPM) API. The aim of this article is to explain the process of gaining the access to EPM API and explaining the available core service at large. I assume that you have already installed EPM modeler and have EPM runtime environment setup with simple process model deployed in it. If you haven't done this, please follow this documentation <link to come soon>.  
  
<br>Once you have EPM up and running with simple process model or models deployed in it, you can start interacting with it via its exposed API. Normally, you will access the EPM services (API) via various different ways like as local spring services, spring remoting, or over WS API depending on your deployment setup.&nbsp;
+
<br>Once you have EPM up and running with simple process model or models deployed in it, you can start interacting with it via its exposed API. Normally, you will access the EPM services (API) via various different ways like as local spring services, spring remoting, or over WS API depending on your deployment setup.&nbsp;  
  
&nbsp;
+
&nbsp;  
  
== Establishing Connection with Runtime Environment ==
+
== Establishing Connection with Runtime Environment ==
  
 
<br>You will use the appropriate service factory to authenticate and establish connection with EPM runtime environment. We will see in detail how we use different service factories in separate article. Assuming you authenticate and establish connection with EPM runtime, you can get a reference to EPM services via initialized service factory.  
 
<br>You will use the appropriate service factory to authenticate and establish connection with EPM runtime environment. We will see in detail how we use different service factories in separate article. Assuming you authenticate and establish connection with EPM runtime, you can get a reference to EPM services via initialized service factory.  
Line 13: Line 13:
 
<br>You can initialize the service factory as simple as this;<br>
 
<br>You can initialize the service factory as simple as this;<br>
 
<pre>ServiceFactory sf = ServiceFactoryLocator.get(user, pwd, properties);</pre>
 
<pre>ServiceFactory sf = ServiceFactoryLocator.get(user, pwd, properties);</pre>
== EPM Services ==
+
== EPM Services ==
  
 
Once you have initialized service factory you can get access to services offered by EPM. The reminder of this section explains the overview of core services and few sample operations of each service.<br>
 
Once you have initialized service factory you can get access to services offered by EPM. The reminder of this section explains the overview of core services and few sample operations of each service.<br>
  
 +
<br>
  
 +
=== Workflow Service  ===
  
=== Workflow Service ===
+
The Workflow Service provides all functionality for workflow operations in an EPM runtime environment.<br>This includes:<br>* starting and aborting process instances,<br>* activating, completing, suspending and aborting activities,<br>* binding and unbinding event handlers,<br>* delegating activities, and<br>* accessing workflow data.
  
The Workflow Service provides all functionality for workflow operations in an EPM runtime environment.<br>This includes:<br>* starting and aborting process instances,<br>* activating, completing, suspending and aborting activities,<br>* binding and unbinding event handlers,<br>* delegating activities, and<br>* accessing workflow data.
+
For example, you can&nbsp;get the workflow service from service factory and execute the startProcess()&nbsp;like this;  
 
+
For example, you can&nbsp;get the workflow service from service factory and execute the startProcess()&nbsp;like this;
+
 
<pre>WorkflowService wfs = sf.getWorkflowService();
 
<pre>WorkflowService wfs = sf.getWorkflowService();
 
workflowService.startPrcoess("LeaveApplicationProcess", inputData, true);
 
workflowService.startPrcoess("LeaveApplicationProcess", inputData, true);
 
</pre>
 
</pre>
Where, the parameters are;<br>param1: process ID of the process which you want to start,<br>param2: input data required to the process in the form of java.util.Map&lt;String, ?&gt;, and<br>param3: flag to indicate if execution to happen synchronously  
+
Where, the parameters are;<br>param1: process ID of the process which you want to start,<br>param2: input data required to the process in the form of java.util.Map&lt;String,&nbsp;?&gt;, and<br>param3: flag to indicate if execution to happen synchronously  
  
 
=== <br>Administration Service  ===
 
=== <br>Administration Service  ===
  
 
This service provides administration services for the EPM runtime environment. An administration service always operates against an audit trail database. The administration service requires that the user performing tasks has been assigned to the predefined role '''Administrator.'''<br>The functionality includes the following tasks:<br>* manage the workflow models (deploy, modify or delete)<br>* recover the runtime environment or single workflow objects<br>* terminate running process instances<br>* manage the life cycle management of CARNOT daemons<br>
 
This service provides administration services for the EPM runtime environment. An administration service always operates against an audit trail database. The administration service requires that the user performing tasks has been assigned to the predefined role '''Administrator.'''<br>The functionality includes the following tasks:<br>* manage the workflow models (deploy, modify or delete)<br>* recover the runtime environment or single workflow objects<br>* terminate running process instances<br>* manage the life cycle management of CARNOT daemons<br>

Revision as of 07:26, 19 October 2011

Introduction 

This article will give you first taste of Eclipse Process Manager (EPM) API. The aim of this article is to explain the process of gaining the access to EPM API and explaining the available core service at large. I assume that you have already installed EPM modeler and have EPM runtime environment setup with simple process model deployed in it. If you haven't done this, please follow this documentation <link to come soon>.


Once you have EPM up and running with simple process model or models deployed in it, you can start interacting with it via its exposed API. Normally, you will access the EPM services (API) via various different ways like as local spring services, spring remoting, or over WS API depending on your deployment setup. 

 

Establishing Connection with Runtime Environment


You will use the appropriate service factory to authenticate and establish connection with EPM runtime environment. We will see in detail how we use different service factories in separate article. Assuming you authenticate and establish connection with EPM runtime, you can get a reference to EPM services via initialized service factory.


You can initialize the service factory as simple as this;

ServiceFactory sf = ServiceFactoryLocator.get(user, pwd, properties);

EPM Services

Once you have initialized service factory you can get access to services offered by EPM. The reminder of this section explains the overview of core services and few sample operations of each service.


Workflow Service

The Workflow Service provides all functionality for workflow operations in an EPM runtime environment.
This includes:
* starting and aborting process instances,
* activating, completing, suspending and aborting activities,
* binding and unbinding event handlers,
* delegating activities, and
* accessing workflow data.

For example, you can get the workflow service from service factory and execute the startProcess() like this;

WorkflowService wfs = sf.getWorkflowService();
workflowService.startPrcoess("LeaveApplicationProcess", inputData, true);

Where, the parameters are;
param1: process ID of the process which you want to start,
param2: input data required to the process in the form of java.util.Map<String, ?>, and
param3: flag to indicate if execution to happen synchronously


Administration Service

This service provides administration services for the EPM runtime environment. An administration service always operates against an audit trail database. The administration service requires that the user performing tasks has been assigned to the predefined role Administrator.
The functionality includes the following tasks:
* manage the workflow models (deploy, modify or delete)
* recover the runtime environment or single workflow objects
* terminate running process instances
* manage the life cycle management of CARNOT daemons

Back to the top