-
1. Re: Execution of bpmn processes from java code.
kcbabo Aug 15, 2014 9:42 AM (in response to dsouzapreethi)You mentioned that the processes are deployed in S-RAMP. Are these for design-time governance workflows or are they used for service orchestration inside a FSW runtime?
-
2. Re: Execution of bpmn processes from java code.
dsouzapreethi Oct 21, 2014 5:00 AM (in response to kcbabo)Hi Keith,
Thanks for ur reply.
I am able to resolve this problem with SrampAtomApiClient API.
Here is my code snippet:
private static final String endpoint = "http://localhost:8080/s-ramp-server";
private static final String user = "test";
private static final String password = "test@123";
private static String SRAMP_KIE_JAR_QUERY_FORMAT="/s-ramp/ext/KieJarArchive[" //$NON-NLS-1$
+ "@maven.groupId='%s' and " //$NON-NLS-1$
+ "@maven.artifactId = '%s' and " //$NON-NLS-1$
+ "@maven.version = '%s']"; //$NON-NLS-1$
SrampAtomApiClient client = new SrampAtomApiClient(endpoint, username, password, true);
String srampQuery = String.format(SRAMP_KIE_JAR_QUERY_FORMAT, "com.sramp", "srampproj", "1.0");
QueryResultSet results = client.query(srampQuery);
ArtifactSummary artifactSummery = results.get(0);
InputStream is = client.getArtifactContent(artifactSummery);
KieServices ks = KieServices.Factory.get();
KieRepository repo = ks.getRepository();
KieModule kModule = repo.addKieModule(ks.getResources().newInputStreamResource(is));
KieContainer kContainer = ks.newKieContainer(kModule.getReleaseId());
KieSession session1=kContainer.newKieSession();
session1.startProcess("srampproj.samplebpmn");