customers and partners access

APIM - Developer Kit (ADK)

APIM is shipped with a Framework that helps developpers to connect with the Integration Workflow Engine.
For example, after modeling the Workflow the next step is either to use the APIM Portal or to develop/integrate with the Corporate Web Portal. With the APIM Framework you will be able to feed the workflow with new requests, see incomming transactions in the user's Work Basket, track the requests, validate or reject transactions, etc.

Here are the samples:

bullet Start a new process

ApimTxData data=new ApimTxData(-1, 348); //transaction id, action id
ApimTxAuth auth=new ApimTxAuth("login","passwd"); //authentication
ApimElement[] variables=new ApimElement[3]; //data
variables[0]= new ApimElement("FirstName","John",0);
variables[1]= new ApimElement("LastName","Doe",0);
variables[2]= new ApimElement("Email","This email address is being protected from spambots. You need JavaScript enabled to view it.",0);

ApimInbox inbox=new ApimInbox();
//send the new transaction to the integration workflow engine
ApimReport report=inbox.connector(data,auth,variables.length,variables);

//check response code
if (report.getCode()!=report.OK)
System.out.println("Transaction rejected:"+report.getMsg());

Note: APIM is shipped with Java,C++ and Ms Visual Basic examples to start new process.

bullet Get Work Basket

//Initialize APIM app

//Get current user
ApimUserPrincipal user=(ApimUserPrincipal) SessionCheck.getUserPrincipal(request);

//Connecting to the Workflow Server
Workflow w = new Workflow();

//request user work basket
List basket = w.getBasket(user.getName());

Iterator basketI=basket.iterator();
//iterate through
while (basketI.hasNext())
BasketEntry be=(BasketEntry) basket.next();

//get transactions
List txp = w.getTxProcs(user.getName(),be,Boolean.TRUE);
Iterator txpi=txp.iterator();
//list content
while (txpi.hasNext())
ATproc proc=(ATproc)txpi.next();

System.out.println("Transaction #"+proc.getIdTx()+" received "+proc.getInDate().toString());

bullet Get Transaction


Transaction ApimTx=null;


Workflow w=new Workflow();

//Lock the transaction for the specified user
w.procLock(user.getName(),192, 105);

//Load the transaction #192, on action #105 - IDs read from the work basket
ApimTx = w.getTransaction(192, 105);

catch (Exception e)
ApimDebug.fail(getClass(),"Unable to retrieve the transaction",e);

Go to top