How to interact with bpm from Progress ABL?

Posted by stefan.tersin@exicom.se on 12-May-2014 05:54

Hello,

where can I find documentation and examples on how to programmatically interact between progress and oebpm? (For example how to get a user’s "my tasks" or start a process / complete a workstep.)

We are using oebpm 11.3.

Thanks in advance,
/Stefan

Posted by Jawahar Surapaneni on 12-May-2014 06:16

Sample code to get tasks

Using Progress.BPM.*.

{url.i}

{classchain.i}

DEFINE VARIABLE oSession  AS CLASS UserSession.

DEF VAR mytask AS CLASS Task extent .

DEF VAR methret AS LOGICAL.

def var i as int.

def var savextent as int.

def var username as char init "user5task".

def var processname as char init "bpmproject2".

output to gcassign1.out append.

MESSAGE "*************Start Testing**********************".

oSession = NEW Progress.BPM.usersession(bizlogicurl).

if oSession:connect( username, username)

THEN DO:

   /* get assigned tasks for user5task */

   mytask = oSession:getassignedtasks().

   savextent = extent(mytask).

   message "Number of tasks returned: " savextent.

   do i = 1 to savextent:

       run displaytasks.p(mytask[i],osession).

   end.

   /* note: do not disconnect since we are testing garbage collection*/

   /* after a Disconnect(NO)                                           */

   /*    methret = oSession:Disconnect(NO).*/

END.

message "Object chain before delete useression:".

run classChain.

DELETE OBJECT oSession.

MESSAGE skip(2) "Object chain after delete useression"

       SKIP    "The entire tree should be gone!".

MESSAGE "valid-object userSession? " VALID-OBJECT(oSession).

run classChain.

do i = 1 to savextent:

   MESSAGE "valid-object task? " VALID-OBJECT(mytask[i]).

end.

Sample Code to Complete a Process Instance

ofilter = NEW TaskProcessFilter (piName ).

mytask = oSession:getAvailabletasks(ofilter) NO-ERROR.

mytask[1]:COMPLETE().

All Replies

Posted by Lakshmi Padmaja on 12-May-2014 05:58
Hi Stefan,
 
Below is small snippet of code to connect to the BP server and start process.
 
Using Progress.BPM.*.
USING progress.lang.*.
DEFINE VARIABLE oSession  AS CLASS UserSession.
def var usersrc as char init "admin".
def var processname as char init "ds1xml". /*Application name*/
def var i as int.
def var lc1 as longchar.
def var bizlogicurl as char init "-URL SBMServerDC://<Machine name>:18793".
 
 
 
/* create session object*/
oSession = NEW Progress.BPM.usersession(bizlogicurl).
 
/* connect*/
oSession:connect( usersrc,usersrc) no-error.
if oSession:connected then do:  
 
/* create process that is for any member of group*/
   oprocess = osession:startprocess(processname). 
 
 
 
    /* disconnect*/
    oSession:Disconnect(yes).
  
 
 
Regards,
Lakshmi
 
[collapse]
From: stefan.tersin@exicom.se [mailto:bounce-stefantersinexicomse@community.progress.com]
Sent: Monday, May 12, 2014 4:25 PM
To: TU.BPM@community.progress.com
Subject: How to interact with bpm from Progress ABL?
 
Thread created by stefan.tersin@exicom.se

Hello,

where can I find documentation and examples on how to programmatically interact between progress and oebpm? (For example how to get a user’s "my tasks" or start a process / complete a workstep.)

We are using oebpm 11.3.

Thanks in advance,
/Stefan

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]
Posted by Jawahar Surapaneni on 12-May-2014 05:59

Hi Stefan,

After opening Studio, just navigate from Window -> ShowView and select Class BrowseIn ClassBrowser , you can see all API references related BPM

Regards,

Jawahar

Posted by daniel.baciu on 12-May-2014 06:02

Hi Stephan,

Please find some examples in here.


Daniel.

Posted by stefan.tersin@exicom.se on 12-May-2014 06:06

Hello,

I am sorry but your link doesn't appear to work.

Regards,

/Stefan

Posted by sdhavala on 12-May-2014 06:14

Hi,

You can find one example in the below link

download.psdn.com/.../OEBPM_API_Notes.pdf

Open the Help from Developer Studio. And navigate to  Progress Developer Studio for OpenEdge Guide > ABL Language Reference. Here you can find API in-detail.

thanks

satyam

Posted by Jawahar Surapaneni on 12-May-2014 06:16

Sample code to get tasks

Using Progress.BPM.*.

{url.i}

{classchain.i}

DEFINE VARIABLE oSession  AS CLASS UserSession.

DEF VAR mytask AS CLASS Task extent .

DEF VAR methret AS LOGICAL.

def var i as int.

def var savextent as int.

def var username as char init "user5task".

def var processname as char init "bpmproject2".

output to gcassign1.out append.

MESSAGE "*************Start Testing**********************".

oSession = NEW Progress.BPM.usersession(bizlogicurl).

if oSession:connect( username, username)

THEN DO:

   /* get assigned tasks for user5task */

   mytask = oSession:getassignedtasks().

   savextent = extent(mytask).

   message "Number of tasks returned: " savextent.

   do i = 1 to savextent:

       run displaytasks.p(mytask[i],osession).

   end.

   /* note: do not disconnect since we are testing garbage collection*/

   /* after a Disconnect(NO)                                           */

   /*    methret = oSession:Disconnect(NO).*/

END.

message "Object chain before delete useression:".

run classChain.

DELETE OBJECT oSession.

MESSAGE skip(2) "Object chain after delete useression"

       SKIP    "The entire tree should be gone!".

MESSAGE "valid-object userSession? " VALID-OBJECT(oSession).

run classChain.

do i = 1 to savextent:

   MESSAGE "valid-object task? " VALID-OBJECT(mytask[i]).

end.

Sample Code to Complete a Process Instance

ofilter = NEW TaskProcessFilter (piName ).

mytask = oSession:getAvailabletasks(ofilter) NO-ERROR.

mytask[1]:COMPLETE().

This thread is closed