Eclipse Examples

6 posts / 0 new
Last post
SaNta
Offline
Last seen: 2 years 7 months ago
Joined: 11/11/2011 - 11:43
Posts: 9
Eclipse Examples

Hi, after my previous posts, i started reading the user manual ... and ... i got stuck on setting my eclipse to work with the examples provided. I followed the steps:

1. Downloaded Activiti-5.8
2. Downloaded Eclipse
3. In Eclipse I Clicked File -> Import -> Existing Projects into Workspace
4. Browsed for Unpacked activiti-5.8/workspace folder
5. After clicking finish the eclipse loaded the files into workspace, but, i got up to 51 errors .. like (Project 'activiti-cxf-examples' is missing required library: 'libs-runtime/commons-lang-2.4.jar') ... etc

How can I fix this problem ?

And also I downloaded the activiti-in-action examples and i wanted to get started with those, but there is no guide on how to import or start with theese examples... i´ve also read the MEAP Chapter 1 on Activiti in Action pdf, but there is no clear explanation on how to use those in eclipse, or netbeans, ... etc.

LisaMa
Offline
Last seen: 2 years 8 months ago
Joined: 08/19/2011 - 09:56
Posts: 27

Those errors are easily fixed by importing the missing *.jars.

Just rightclick on the project, click on properties and then on "Java Build Path". Open the Libraries View and there on the right side click on "Add external JARs". In the popup window navigate to your workspace/activiti-engine-examples/libs-runtime folder and add all the jars in there to the project. That
should resolve the errors.

SaNta
Offline
Last seen: 2 years 7 months ago
Joined: 11/11/2011 - 11:43
Posts: 9

OK, I´ve tried to do as you said. But right after that, i looked for the libs ... the bad thing is, that my activiti-cxf-examples is missing required library -> libs-runtime/commons-lang-2.4.jar. This lib i havent found in any af the hierarchy of activiti 5.8. The mentioned lib is one of the 51 i´m missing. Weren´t they suppose to be in the archive of activiti-5.8 ? All packed and no additional downloading required ?

SaNta
Offline
Last seen: 2 years 7 months ago
Joined: 11/11/2011 - 11:43
Posts: 9

OK, so i manually downloaded all of the missing, but now i´ve got suck on AbstractWebServiceTaskTest.java, where it say´s that the "method destroy() is undefined for type Server"

LisaMa
Offline
Last seen: 2 years 8 months ago
Joined: 08/19/2011 - 09:56
Posts: 27

I have no such error, did you maybe accidentally removed the import?

import org.apache.cxf.endpoint.Server;

SaNta
Offline
Last seen: 2 years 7 months ago
Joined: 11/11/2011 - 11:43
Posts: 9

No the import is there, and i havent done no erasing ... imported the project and these errors came up. Beside of that .. i have another question ... i followed the ten minute tutorial ... in the last point we create something like this

import java.util.List;
 
import org.activiti.engine.HistoryService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.impl.test.PluggableActivitiTestCase;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.repository.Deployment;
 
public class TenMinuteTutorial {
 
  public static void main(String[] args) {
 
    // Create Activiti process engine
    ProcessEngine processEngine = ProcessEngineConfiguration
      .createStandaloneProcessEngineConfiguration()
      .buildProcessEngine();
 
    // Get Activiti services
    RepositoryService repositoryService = processEngine.getRepositoryService();
    RuntimeService runtimeService = processEngine.getRuntimeService();
 
    // Deploy the process definition
    repositoryService.createDeployment()
      .addClasspathResource("FinancialReportProcess.bpmn20.xml")
      .deploy();
 
    // Start a process instance
    String procId = runtimeService.startProcessInstanceByKey("financialReport").getId();
 
    // Get the first task
    TaskService taskService = processEngine.getTaskService();
    List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup("accountancy").list();
    for (Task task : tasks) {
      System.out.println("Following task is available for accountancy group: " + task.getName());
 
      // claim it
      taskService.claim(task.getId(), "fozzie");
    }
 
    // Verify Fozzie can now retrieve the task
    tasks = taskService.createTaskQuery().taskAssignee("fozzie").list();
    for (Task task : tasks) {
      System.out.println("Task for fozzie: " + task.getName());
 
      // Complete the task
      taskService.complete(task.getId());
    }
 
    System.out.println("Number of tasks for fozzie: " 
            + taskService.createTaskQuery().taskAssignee("fozzie").count());
 
    // Retrieve and claim the second task
    tasks = taskService.createTaskQuery().taskCandidateGroup("management").list();
    for (Task task : tasks) {
      System.out.println("Following task is available for accountancy group: " + task.getName());
      taskService.claim(task.getId(), "kermit");
    }
 
    // Completing the second task ends the process
    for (Task task : tasks) {
      taskService.complete(task.getId());
    }
 
    // verify that the process is actually finished
    HistoryService historyService = processEngine.getHistoryService();
    HistoricProcessInstance historicProcessInstance = 
      historyService.createHistoricProcessInstanceQuery().processInstanceId(procId).singleResult();
    System.out.println("Process instance end time: " + historicProcessInstance.getEndTime());
  }
 
}

how do i test it ? ... or better ... how do i test more activiti-engine exapmples ... or even better ... how to play with the activiti-in-action examples ?