@Override
  public void setProcessVariable(long processInstanceId, String variableId, Object value) {
    ProcessInstanceDesc piDesc = dataService.getProcessInstanceById(processInstanceId);
    KieSession ksession = domainService.getSessionById(piDesc.getSessionId());
    ProcessInstance processInstance = ksession.getProcessInstance(processInstanceId);

    ((WorkflowProcessInstance) processInstance).setVariable(variableId, value);
  }
 @Override
 public org.uberfire.backend.vfs.Path getProcessAssetPath(String processId) {
   String reporoot = fs.getRepositoryRoot();
   if (reporoot.endsWith("/")) {
     reporoot = reporoot.substring(0, (reporoot.length() - 1));
   }
   String uri = reporoot + domainService.getProcessAssetPath(processId);
   String name = uri.substring(uri.lastIndexOf("/") + 1);
   return PathFactory.newPath(fileSystems.getBootstrapFileSystem(), name, uri);
 }
  @Test
  public void testFindReusableSubProcesses() {

    knolwedgeService.createDomain();
    String theString = "ParentProcess";

    assertNotNull(theString);
    Collection<String> reusableProcesses = bpmn2Service.getReusableSubProcesses(theString);
    assertNotNull(reusableProcesses);
    assertEquals(1, reusableProcesses.size());

    assertEquals("signal", reusableProcesses.iterator().next());
  }
  @Override
  public Collection<String> getAvailableSignals(String businessKey, long processInstanceId) {
    ProcessInstanceDesc piDesc = dataService.getProcessInstanceById(processInstanceId);
    KieSession ksession = domainService.getSessionById(piDesc.getSessionId());
    ProcessInstance processInstance = ksession.getProcessInstance(processInstanceId);
    Collection<String> activeSignals = new ArrayList<String>();

    if (processInstance != null) {
      ((ProcessInstanceImpl) processInstance)
          .setProcess(ksession.getKieBase().getProcess(processInstance.getProcessId()));
      Collection<NodeInstance> activeNodes =
          ((WorkflowProcessInstance) processInstance).getNodeInstances();

      activeSignals.addAll(ProcessInstanceHelper.collectActiveSignals(activeNodes));
    }

    return activeSignals;
  }
  @Test
  public void hello() throws IOException {

    knolwedgeService.createDomain();

    String theString = "org.jbpm.writedocument";

    Collection<TaskDef> processTasks = bpmn2Service.getAllTasksDef(theString);

    assertEquals(3, processTasks.size());
    Map<String, String> processData = bpmn2Service.getProcessData(theString);

    assertEquals(3, processData.keySet().size());
    Map<String, String> taskInputMappings =
        bpmn2Service.getTaskInputMappings(theString, "Write a Document");

    assertEquals(3, taskInputMappings.keySet().size());

    Map<String, String> taskOutputMappings =
        bpmn2Service.getTaskOutputMappings(theString, "Write a Document");

    assertEquals(1, taskOutputMappings.keySet().size());
  }
 public int getAmountOfSessions() {
   return domainService.getAmountOfSessions();
 }
 public Collection<String> getSessionsNames() {
   return domainService.getSessionsNames();
 }
 public StatefulKnowledgeSessionSummary getSessionSummaryByName(int sessionId) {
   return StatefulKnowledgeSessionHelper.adapt(domainService.getSessionById(sessionId));
 }
 public void createDomain() {
   domainService.createDomain();
 }
 public Map<String, String> getAvailableProcessesPath() {
   return domainService.getAvailableProcessesPaths();
 }