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