use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.
the class ProcessInstanceMigrationServiceImplTest method prepare.
@Before
public void prepare() {
configureServices();
logger.debug("Preparing kjar");
KieServices ks = KieServices.Factory.get();
// version 1 of kjar
ReleaseId releaseId = ks.newReleaseId(MIGRATION_GROUP_ID, MIGRATION_ARTIFACT_ID, MIGRATION_VERSION_V1);
List<String> processes = new ArrayList<String>();
processes.add("migration/v1/AddTaskAfterActive-v1.bpmn2");
processes.add("migration/v1/RemoveActiveTask-v1.bpmn2");
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
File pom = new File("target/migration-v1", "pom.xml");
pom.getParentFile().mkdir();
try {
FileOutputStream fs = new FileOutputStream(pom);
fs.write(getPom(releaseId).getBytes());
fs.close();
} catch (Exception e) {
}
KieMavenRepository repository = getKieMavenRepository();
repository.installArtifact(releaseId, kJar1, pom);
// version 2 of kjar
ReleaseId releaseId2 = ks.newReleaseId(MIGRATION_GROUP_ID, MIGRATION_ARTIFACT_ID, MIGRATION_VERSION_V2);
processes = new ArrayList<String>();
processes.add("migration/v2/AddTaskAfterActive-v2.bpmn2");
processes.add("migration/v2/RemoveActiveTask-v2.bpmn2");
InternalKieModule kJar2 = createKieJar(ks, releaseId2, processes);
File pom2 = new File("target/migration-v2", "pom.xml");
pom2.getParentFile().mkdirs();
try {
FileOutputStream fs = new FileOutputStream(pom2);
fs.write(getPom(releaseId2).getBytes());
fs.close();
} catch (Exception e) {
}
repository = getKieMavenRepository();
repository.installArtifact(releaseId2, kJar2, pom2);
migrationService = new ProcessInstanceMigrationServiceImpl();
// now let's deploy to runtime both kjars
deploymentUnitV1 = new KModuleDeploymentUnit(MIGRATION_GROUP_ID, MIGRATION_ARTIFACT_ID, MIGRATION_VERSION_V1);
deploymentService.deploy(deploymentUnitV1);
units.add(deploymentUnitV1);
deploymentUnitV2 = new KModuleDeploymentUnit(MIGRATION_GROUP_ID, MIGRATION_ARTIFACT_ID, MIGRATION_VERSION_V2);
deploymentService.deploy(deploymentUnitV2);
units.add(deploymentUnitV2);
}
use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.
the class UserTaskAdminServiceImplTest method prepare.
@Before
public void prepare() {
configureServices();
logger.debug("Preparing kjar");
KieServices ks = KieServices.Factory.get();
// version 1 of kjar
ReleaseId releaseId = ks.newReleaseId(ADMIN_GROUP_ID, ADMIN_ARTIFACT_ID, ADMIN_VERSION_V1);
List<String> processes = new ArrayList<String>();
processes.add("repo/processes/general/humanTask.bpmn");
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
File pom = new File("target/admin", "pom.xml");
pom.getParentFile().mkdir();
try {
FileOutputStream fs = new FileOutputStream(pom);
fs.write(getPom(releaseId).getBytes());
fs.close();
} catch (Exception e) {
}
KieMavenRepository repository = getKieMavenRepository();
repository.installArtifact(releaseId, kJar1, pom);
userTaskAdminService = new UserTaskAdminServiceImpl();
((UserTaskAdminServiceImpl) userTaskAdminService).setUserTaskService(userTaskService);
((UserTaskAdminServiceImpl) userTaskAdminService).setRuntimeDataService(runtimeDataService);
((UserTaskAdminServiceImpl) userTaskAdminService).setIdentityProvider(identityProvider);
((UserTaskAdminServiceImpl) userTaskAdminService).setCommandService(new TransactionalCommandService(emf));
// now let's deploy to runtime both kjars
deploymentUnit = new KModuleDeploymentUnit(ADMIN_GROUP_ID, ADMIN_ARTIFACT_ID, ADMIN_VERSION_V1);
deploymentService.deploy(deploymentUnit);
units.add(deploymentUnit);
// set user to administrator so it will be allowed to do operations
identityProvider.setName("Administrator");
identityProvider.setRoles(Collections.singletonList(""));
}
use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.
the class DeactivateDeploymentServiceWithSyncTest method prepare.
@Before
public void prepare() {
configureServices();
KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
List<String> processes = new ArrayList<String>();
processes.add("repo/processes/general/customtask.bpmn");
processes.add("repo/processes/general/humanTask.bpmn");
processes.add("repo/processes/general/signal.bpmn");
processes.add("repo/processes/general/import.bpmn");
processes.add("repo/processes/general/callactivity.bpmn");
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
File pom = new File("target/kmodule", "pom.xml");
pom.getParentFile().mkdir();
try {
FileOutputStream fs = new FileOutputStream(pom);
fs.write(getPom(releaseId).getBytes());
fs.close();
} catch (Exception e) {
}
KieMavenRepository repository = getKieMavenRepository();
repository.deployArtifact(releaseId, kJar1, pom);
ReleaseId releaseIdSupport = ks.newReleaseId(GROUP_ID, "support", VERSION);
List<String> processesSupport = new ArrayList<String>();
processesSupport.add("repo/processes/support/support.bpmn");
InternalKieModule kJar2 = createKieJar(ks, releaseIdSupport, processesSupport);
File pom2 = new File("target/kmodule2", "pom.xml");
pom2.getParentFile().mkdir();
try {
FileOutputStream fs = new FileOutputStream(pom2);
fs.write(getPom(releaseIdSupport).getBytes());
fs.close();
} catch (Exception e) {
}
repository.deployArtifact(releaseIdSupport, kJar2, pom2);
configureDeploymentSync();
}
use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.
the class RuntimeDataServiceEJBIntegrationTest method deployKjar.
protected static void deployKjar() {
KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
List<String> processes = new ArrayList<String>();
processes.add("processes/EmptyHumanTask.bpmn");
processes.add("processes/humanTask.bpmn");
processes.add("processes/SimpleHTProcess.bpmn2");
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
File pom = new File("target/kmodule", "pom.xml");
pom.getParentFile().mkdir();
try {
FileOutputStream fs = new FileOutputStream(pom);
fs.write(getPom(releaseId).getBytes());
fs.close();
} catch (Exception e) {
}
KieMavenRepository repository = getKieMavenRepository();
repository.installArtifact(releaseId, kJar1, pom);
}
use of org.kie.scanner.KieMavenRepository in project jbpm by kiegroup.
the class UserTaskServiceEJBIntegrationTest method deployKjar.
protected static void deployKjar() {
KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION);
List<String> processes = new ArrayList<String>();
processes.add("processes/EmptyHumanTask.bpmn");
processes.add("processes/humanTask.bpmn");
InternalKieModule kJar1 = createKieJar(ks, releaseId, processes);
File pom = new File("target/kmodule", "pom.xml");
pom.getParentFile().mkdir();
try {
FileOutputStream fs = new FileOutputStream(pom);
fs.write(getPom(releaseId).getBytes());
fs.close();
} catch (Exception e) {
}
KieMavenRepository repository = getKieMavenRepository();
repository.installArtifact(releaseId, kJar1, pom);
}
Aggregations