private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { //logger.log(Level.SEVERE, "Unable to add user " + userId); } }
private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { logger.log(Level.SEVERE, "Unable to add user " + userId); } } // ALL THIS CODE SHOULD NOT BE HERE>> THIS IS PLACED HERE TO DEMONSTRATE THAT IS WRONG
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { id = in.readLong(); text = in.readUTF(); addedBy = new User(); addedBy.readExternal( in ); addedAt = new Date( in.readLong() ); }
private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { //logger.log(Level.SEVERE, "Unable to add user " + userId); } }
private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { //logger.log(Level.SEVERE, "Unable to add user " + userId); } } }
private void addUserFromCallbackOperation(String userId) { try { boolean userExists = em.find(User.class, userId) != null; if (!StringUtils.isEmpty(userId) && !userExists) { User user = new User(userId); em.persist(user); } } catch (Throwable t) { //logger.log(Level.SEVERE, "Unable to add user " + userId); } } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { id = in.readLong(); name = in.readUTF(); accessType = AccessType.valueOf( in.readUTF() ); contentType = in.readUTF(); attachedBy = new User(); attachedBy.readExternal( in ); attachedAt = new Date( in.readLong() ); size = in.readInt( ); attachmentContentId = in.readLong(); }
private void addUserjButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addUserjButtonActionPerformed if (userjTextField.getText() != null && !userjTextField.getText().equals("")) { User user = new User(userjTextField.getText()); taskSession.addUser(user); users.put(userjTextField.getText(), user); this.synchronizeUserComboBoxModel(); } }//GEN-LAST:event_addUserjButtonActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed Map<String, Object> vars = new HashMap(); Map<String, User> users = new HashMap<String, User>(); for (String user : taskServerDaemon.getDefaultUsers()) { users.put(user, new User(user)); } vars.put("users", users); vars.put("now", new Date()); Task task = (Task) TaskServerDaemon.eval(new StringReader(taskDefinitionjTextArea.getText()), vars); ksession.insert(task); }//GEN-LAST:event_jButton3ActionPerformed
private void addUsersAndGroups(TaskServiceSession taskSession) { User user = new User("salaboy"); User watman = new User("watman"); taskSession.addUser(user); taskSession.addUser(watman); User administrator = new User("Administrator"); taskSession.addUser(administrator); users.put("salaboy", user); users.put("watman", watman); users.put("administrator", administrator); Group myGroup = new Group("group1"); taskSession.addGroup(myGroup); groups.put("group1", myGroup); this.synchronizeUserComboBoxModel(); }
public static List<OrganizationalEntity> readOrganizationalEntityList(ObjectInput in) throws IOException, ClassNotFoundException { int size = in.readInt(); List<OrganizationalEntity> list = new ArrayList<OrganizationalEntity>(size); for ( int i = 0; i < size; i++ ) { short type = in.readShort(); if ( type == 0 ) { User user = new User(); user.readExternal( in ); list.add( user ); } else { Group group = new Group(); group.readExternal( in ); list.add( group ); } } return list; } }
Attribute member = sr.getAttributes().get(roleAttrId); for (int i = 0; i < member.size(); i++) { memebers.add(new User(member.get(i).toString()));
public void startServer() { if(isRunning()) throw new IllegalStateException("Server is already started"); this.running = true; EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("org.drools.task"); TaskService taskService = new TaskService(entityManagerFactory, SystemEventListenerFactory.getSystemEventListener()); TaskServiceSession taskSession = taskService.createSession() ; MockUserInfo userInfo = new MockUserInfo(); taskService.setUserinfo( userInfo); for (String userName : getDefaultUsers()) { taskSession.addUser(new User(userName)); } taskServer = new HornetQTaskServer(taskService, 5443); Thread thread = new Thread(taskServer); thread.start(); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { if ( in.readBoolean() ) { taskInitiator = new User(); taskInitiator.readExternal( in ); } potentialOwners = CollectionUtils.readOrganizationalEntityList( in ); excludedOwners = CollectionUtils.readOrganizationalEntityList( in ); taskStakeholders = CollectionUtils.readOrganizationalEntityList( in ); businessAdministrators = CollectionUtils.readOrganizationalEntityList( in ); recipients = CollectionUtils.readOrganizationalEntityList( in ); }
ksession.insert(new Average(1.0)); thresholdFactHandle = ksession.insert(avgThreshold); ksession.insert(new User("salaboy"));
TaskServiceSession localTaskServiceSession = localTaskService.createSession(); for (int i = 0; i < 10; i++) { User user = new User("usr" + i); localTaskServiceSession.addUser(user);
TaskServiceSession localTaskServiceSession = localTaskService.createSession(); for (int i = 0; i < 10; i++) { User user = new User("usr" + i); localTaskServiceSession.addUser(user);
TaskServiceSession localTaskServiceSession = localTaskService.createSession(); for (int i = 0; i < 10; i++) { User user = new User("usr" + i); localTaskServiceSession.addUser(user);
businessAdmins.add(new User("Administrator")); businessAdmins.addAll(task.getPeopleAssignments().getBusinessAdministrators()); task.getPeopleAssignments().setBusinessAdministrators(businessAdmins);
TaskData taskData = new TaskData(); taskData.setStatus(Status.Created); taskData.setCreatedBy(new User("usr0")); taskData.setActualOwner(new User("usr0")); task.setTaskData(taskData); TaskData taskData2 = new TaskData(); taskData2.setStatus(Status.Created); taskData2.setCreatedBy(new User("usr0")); taskData2.setActualOwner(new User("usr0")); task2.setTaskData(taskData2);