Bonita API sur CAS

1
0
-1

J'ai develope un portlet liferay qui prend le nomero des processus pour un utilisateur. Tout marche bien(je prend bien le noumereo des processus),mais quand je met bonita en CAS je recois une erreure quand j'essay faire le login(APISession session = loginAPI.login("install", "install")) L'acces depuis browser en CAS sur bonita marche bien.Est que vous savez qu'est que je doit faire en plus quand je suis en CAS?

Voila la source code et le fichier bonita-client.properties que je utilise public class WorkflowBonita { /** * Bonita home property key */ private static final String BONITA_HOME_KEY = "bonita.home";

public static int getNrProcess(String userName,String url) { int cnt=0; checkBonitaHome(url); try {

 final LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();
 APISession session = loginAPI.login("install", "install");
 IdentityAPI identityAPI = TenantAPIAccessor.getIdentityAPI(session);

 ProcessAPI processAPI = TenantAPIAccessor.getProcessAPI(session); 

User user=identityAPI.getUserByUserName(userName);
cnt=(int)processAPI.getNumberOfAssignedHumanTaskInstances(user.getId());

} catch (BonitaException e) { // TODO Auto-generated catch block e.printStackTrace(); }

return cnt;

} public static PlatformSession doPlatformLogin(String platformUsername, String password) throws BonitaException { return getPlaformLoginAPI().login(platformUsername, password); } private static PlatformLoginAPI getPlaformLoginAPI() throws BonitaException { return PlatformAPIAccessor.getPlatformLoginAPI(); }

private static PlatformAPI getPlatformAPI(PlatformSession platformSession) throws BonitaException { return PlatformAPIAccessor.getPlatformAPI(platformSession); } private static void checkBonitaHome(String url) {

System.setProperty("bonita.home", url); String bonitaHome = System.getProperty(BONITA_HOME_KEY); if (bonitaHome == null) { throw new RuntimeException("The system property bonita.home is not set. Please, set this property with the path to the bonita home folder.\n " + "You can get a bonita home from BonitaBPMCommunity-<bonita.engine.version>-deploy.zip or use the one generated under \n" + "the folder target/home on this project by running the command 'mvn clean install'."); }

} }

Contenu du mon bonita-client.properties

LOCAL org.bonitasoft.engine.api-type = LOCAL HTTP

org.bonitasoft.engine.api-type = HTTP server.url = http://localhost:8080 application.name = bonita

Remote: EJB3 / JBoss 5 org.bonitasoft.engine.api-type = EJB3 java.naming.factory.initial = org.jnp.interfaces.NamingContextFactory java.naming.provider.url = jnp://localhost:1099

Comments

Submitted by ttoine on Wed, 05/28/2014 - 11:51

Salut, tu peux nous en dire plus sur ta version de Bonita ?

Submitted by mogosanuozanama... on Wed, 05/28/2014 - 11:55

C'est une version Bonita 6.2,vous avez besoind des autre information?

Submitted by ttoine on Wed, 05/28/2014 - 12:06

CAS ne fonctionnait pas avec Bonita 6.0 à 6.2. Pourrais tu essayer avec la 6.3 ? Je sais qu'avec les versions Subscription c''est facile, et que c'est désormais possible avec la Community edition. Par contre, ça peut nécessiter de bidouiller un peu avec cette dernière.

Submitted by mogosanuozanama... on Wed, 05/28/2014 - 13:19

Ok,merci je va essayer avec un 6.3:)

No answers yet.
Notifications