use of org.jbpm.services.task.impl.model.ContentImpl in project jbpm by kiegroup.
the class AbstractTaskSerializationTest method jaxbContentTest.
@Test
public void jaxbContentTest() throws Exception {
Assume.assumeFalse(getType().equals(TestType.YAML));
ContentImpl content = new ContentImpl();
content.setId(23);
Map<String, Object> map = new HashMap<String, Object>();
map.put("life", new Integer(23));
map.put("sick", new Integer(45));
byte[] bytes = ContentMarshallerHelper.marshallContent(null, map, null);
content.setContent(bytes);
JaxbContent jaxbContent = new JaxbContent(content);
JaxbContent copyJaxbContent = testRoundTrip(jaxbContent);
Assertions.assertThat(jaxbContent).isEqualToComparingFieldByFieldRecursively(copyJaxbContent);
}
use of org.jbpm.services.task.impl.model.ContentImpl in project jbpm by kiegroup.
the class JPATaskPersistenceContext method findTaskIdByContentId.
@Override
public Long findTaskIdByContentId(Long contentId) {
check();
CriteriaBuilder builder = this.em.getCriteriaBuilder();
CriteriaQuery<Long> query = builder.createQuery(Long.class);
Root<TaskImpl> taskRoot = query.from(TaskImpl.class);
Root<ContentImpl> contentRoot = query.from(ContentImpl.class);
query.select(taskRoot.get(TaskImpl_.id));
Predicate taskContentJoinPred = builder.equal(contentRoot.get(ContentImpl_.id), taskRoot.get(TaskImpl_.taskData).get(TaskDataImpl_.outputContentId));
Predicate contentIdPred = builder.equal(contentRoot.get(ContentImpl_.id), contentId);
query.where(builder.and(taskContentJoinPred, contentIdPred));
Query choppedLiver = em.createQuery(query);
return (Long) choppedLiver.getSingleResult();
}
Aggregations