AnsweredAssumed Answered

Activiti Engine Karaf Commands (OSGi shell support)

Question asked by schikkal on Aug 30, 2011
Latest reply on Sep 1, 2014 by trademak
Hi

We are using Activiti Engine in Servicemix/Fuse OSGi container to deploy and run BPMN Processes in the OSGi container.  We are using activiti-osgi, activiti-spring, activiti-engine together (with other dependent bundles) to run the Activiti engine in the OSGi continer. So far things are working well for us. Since we want a quick CLI management interface to the bpmn process deployments, definitions and instances in the Activiti engine , we have added few Karaf commands (shell interface). 

If there is enough interest, I would like to contribute this activiti karaf commands code to the community.  Let me know if anyone looking for this type of interface to Activiti Engine in OSGi container.

Regards,
-Srinivasan

Karaf console output for Activiti commands
================================

….
[ 223] [Active     ] [            ] [       ] [   60] Commons Email (1.2)
[ 224] [Active     ] [            ] [       ] [   60] H2 Database Engine (1.3.155)
[ 226] [Active     ] [            ] [       ] [   60] Apache ServiceMix :: Bundles :: mybatis (3.0.4.1)
[ 227] [Active     ] [            ] [       ] [   60] Activiti - Engine (5.7.0)
[ 228] [Active     ] [            ] [       ] [   60] Activiti - OSGi (5.7.0)
….
karaf@root>

karaf commands for activiti engine
=========================

bpm:list   bpm:start   bpm:signal  bpm:kill   bpm:undeploy

karaf@root> bpm:list –help
DESCRIPTION
        bpm:list

        Displays information about BPMN active process instances, process definitions, history of process instances

SYNTAX
        bpm:list [options]

OPTIONS
        -d, –deployments
                Display information about all BPMN deployments
        -h, –history
                Display information about history of all process instances
        –help
                Display this help message
        -pd, –definitions
                Display information about all process definitions
        -pi, –active
                Display information about all active process instances

karaf@root> bpm:start –help
DESCRIPTION
        bpm:start

        Starts the BPMN process instance from a deployed process definition

SYNTAX
        bpm:start [options] definitionID

ARGUMENTS
        definitionID
                BPMN Process definition ID to start an instance of it.

OPTIONS
        –help
                Display this help message


karaf@root> bpm:signal –help
DESCRIPTION
        bpm:signal

        Signals any active executions in BPMN process instances

SYNTAX
        bpm:signal [options] [instanceIDs]

ARGUMENTS
        instanceIDs
                Instance IDs to signal set of active process instances

OPTIONS
        –help
                Display this help message
        -a, –all
                Signal all active process instances
        -activities, –activities
                Signal all activities in a process instances


karaf@root> bpm:kill –help
DESCRIPTION
        bpm:kill

        Kills any active BPMN process instances

SYNTAX
        bpm:kill [options] [instanceIDs]

ARGUMENTS
        instanceIDs
                Instance IDs to kill set of active process instances

OPTIONS
        –help
                Display this help message
        -a, –all
                Kill all active process instances
               
karaf@root> bpm:undeploy –help
DESCRIPTION
        bpm:undeploy

        Undeploys the BPMN Deployments(Process definition, images, bar files etc

SYNTAX
        bpm:undeploy [options] [deploymentIDs]

ARGUMENTS
        deploymentIDs
                Deployment IDs of the BPMN deployments for undeploying

OPTIONS
        -a, –all
                Undeploys all BPMN deployments
        –help
                Display this help message
        -c, –cascade
                Deletes the given deployment and cascade deletion to process instances, history process instances and
                jobs.
              
bpm:list command output
===================

karaf@root> bpm:list

BPMN Deployments
—————-
ID    Name                                                                       Deployment Time
[1705][mvn:com.cisco.workflow.examples/hello-bpmn-bundle/1.1.0-SNAPSHOT        ][Aug 30, 2011 2:00:07 PM]
[1713][mvn:com.cisco.workflow.examples/bpmn-receive-task-example/1.1.0-SNAPSHOT][Aug 30, 2011 2:13:58 PM]

BPMN Process Definitions
————————-
Definition ID                     Name                       Ver  Resource

[Hello:1:1708                    ][hello                    ][1  ][//233.fwk25337455/diagrams/hello.bpmn20.xml]
[bpmn-receive-task-example:1:1716][bpmn-receive-task-example][1  ][//235.fwk25337455/diagrams/bpmn-receive-task-example.bpmn20.xml]

History of BPMN Process Instances
———————————
Definition ID                     Inst  Start Time               End Time
[Hello:1:1708                    ][1709][Aug 30, 2011 2:00:09 PM][Aug 30, 2011 2:00:09 PM]
[bpmn-receive-task-example:1:1716][1717][Aug 30, 2011 2:14:00 PM][                       ]

Active BPMN Process Instances
—————————–
Definition ID                     Inst  Executions
[bpmn-receive-task-example:1:1716][1717][1717,1719,1720,1721]

Outcomes