@Override
 public void execute(CommandLine command, Configuration configuration, PrintWriter out) {
   final TaskId taskId = new TaskId(command.getArgument());
   final TaskService taskService = new TaskService(configuration);
   final ActivityInstance task =
       taskService.findById(taskId.getWorkflowInstanceId(), taskId.getActivityInstanceId());
   if (task == null) {
     out.println("No task found for ID:" + taskId);
   } else {
     final JsonStreamMapper jsonMapper = configuration.get(JsonStreamMapper.class);
     jsonMapper.pretty();
     out.println(jsonMapper.write(task));
   }
 }
 public <T> T serialize(T o) {
   String jsonString = jsonStreamMapper.write(o);
   System.out.println(jsonString);
   return (T) jsonStreamMapper.readString(jsonString, o.getClass());
 }
 @BeforeClass
 public static void initialize() {
   jsonStreamMapper = new JsonStreamMapper();
   jsonStreamMapper.pretty();
 }
Exemple #4
0
 public BpmnMapper(JsonStreamMapper jsonStreamMapper) {
   this.bpmnMappings = new BpmnMappings(jsonStreamMapper.getMappings());
   this.jsonStreamMapper = jsonStreamMapper;
 }