Examples of Work


Examples of org.drools.process.core.Work

        final GridLayout gridLayout = new GridLayout();
        gridLayout.horizontalSpacing = 2;
        container.setLayout(gridLayout);
        headersTabItem.setControl(container);
       
        Work work = (Work) getValue();
       
        Label nameLabel = new Label(container, SWT.NONE);
        nameLabel.setText("Name: ");
        nameText = new Text(container, SWT.NONE);
        GridData gridData = new GridData();
        gridData.grabExcessHorizontalSpace = true;
        gridData.horizontalAlignment = GridData.FILL;
        nameText.setLayoutData(gridData);
        String name = (String) work.getParameter("TaskName");
        nameText.setText(name == null ? "" : name);
       
    Label label = new Label(container, SWT.NONE);
    label.setText("Actor(s): ");
    actorText = new Text(container, SWT.NONE);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    actorText.setLayoutData(gridData);
    String value = (String) work.getParameter("ActorId");
    actorText.setText(value == null ? "" : value);

    label = new Label(container, SWT.NONE);
    label.setText("Group(s): ");
    groupText = new Text(container, SWT.NONE);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    groupText.setLayoutData(gridData);
    value = (String) work.getParameter("GroupId");
    groupText.setText(value == null ? "" : value);

    label = new Label(container, SWT.NONE);
    label.setText("Comment: ");
    commentText = new Text(container, SWT.MULTI);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.verticalAlignment = GridData.FILL;
    commentText.setLayoutData(gridData);
    value = (String) work.getParameter("Comment");
    commentText.setText(value == null ? "" : value.toString());

    label = new Label(container, SWT.NONE);
    label.setText("Priority: ");
    priorityText = new Text(container, SWT.NONE);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    priorityText.setLayoutData(gridData);
    value = (String) work.getParameter("Priority");
    priorityText.setText(value == null ? "" : value);

    skippableButton = new Button(container, SWT.CHECK | SWT.LEFT);
    skippableButton.setText("Skippable");
    value = (String) work.getParameter("Skippable");
    skippableButton.setSelection("true".equals(value));
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    skippableButton.setLayoutData(gridData);

    label = new Label(container, SWT.NONE);
    label.setText("Content: ");
    contentText = new Text(container, SWT.MULTI);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.verticalAlignment = GridData.FILL;
    contentText.setLayoutData(gridData);
    value = (String) work.getParameter("Content");
    contentText.setText(value == null ? "" : value.toString());
   
    label = new Label(container, SWT.NONE);
    label.setText("Created by: ");
    createdByText = new Text(container, SWT.NONE);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    createdByText.setLayoutData(gridData);
    value = (String) work.getParameter("CreatedBy");
    createdByText.setText(value == null ? "" : value.toString());
   
    label = new Label(container, SWT.NONE);
    label.setText("Locale: ");
    localeText = new Text(container, SWT.NONE);
    gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    localeText.setLayoutData(gridData);
    value = (String) work.getParameter("Locale");
    localeText.setText(value == null ? "en-UK" : value.toString());
  }
View Full Code Here

Examples of org.drools.process.core.Work

    value = (String) work.getParameter("Locale");
    localeText.setText(value == null ? "en-UK" : value.toString());
  }

  private void createReassignmentTab(TabFolder tabFolder) {
    Work work = (Work) getValue();
   
    String notStartedReassign = (String) work.getParameter("NotStartedReassign");
    String notCompletedReassign = (String) work.getParameter("NotCompletedReassign");
   
    if (notStartedReassign != null) {
      String[] reassigns = notStartedReassign.split(COMPONENT_SEPARATOR_ESCAPED);
     
      for (String reassign : reassigns) {
View Full Code Here

Examples of org.drools.process.core.Work

            }
        });
  }
 
  private void createNotificationTab(TabFolder tabFolder) {
    Work work = (Work) getValue();
   
    String notStartedNotify = (String) work.getParameter("NotStartedNotify");
    String notCompletedNotify = (String) work.getParameter("NotCompletedNotify");
   
    if (notStartedNotify != null) {
      String[] notifies = notStartedNotify.split(COMPONENT_SEPARATOR_ESCAPED);
     
      for (String notification : notifies) {
View Full Code Here

Examples of org.drools.process.core.Work

        });
   
  }

  protected Work updateValue(Work value) {
        Work work = new WorkImpl();
        work.setName("Human Task");
        work.setParameter("TaskName", nameText.getText());
        work.setParameter("ActorId", actorText.getText());
        work.setParameter("GroupId", groupText.getText());
        work.setParameter("Comment", commentText.getText());
        work.setParameter("Priority", priorityText.getText());
        work.setParameter("Skippable", skippableButton.getSelection() + "");
        String content = contentText.getText();
        work.setParameter("Content", content.trim().length() == 0 ? null : content);
        work.setParameter("CreatedBy", createdByText.getText());
        work.setParameter("Locale", localeText.getText());
       
        // process reassignment
        if (!reassignments.isEmpty()) {
          StringBuffer notStartedReassignments = new StringBuffer();
          StringBuffer notCompletedReassignments = new StringBuffer();
          for (Reassignment reassign : reassignments) {
            if ("not-started".equalsIgnoreCase(reassign.getTypeAsString())) {
              if (notStartedReassignments.length() > 0) {
                notStartedReassignments.append(COMPONENT_SEPARATOR);
              }
              notStartedReassignments.append(reassign.toDataInput());
            } else if ("not-completed".equalsIgnoreCase(reassign.getTypeAsString())) {
              if (notCompletedReassignments.length() > 0) {
                notCompletedReassignments.append(COMPONENT_SEPARATOR);
              }
              notCompletedReassignments.append(reassign.toDataInput());
            }
          }
          if (notStartedReassignments.length() > 0) {
            work.setParameter("NotStartedReassign", notStartedReassignments.toString());
          }
          if (notCompletedReassignments.length() > 0) {
            work.setParameter("NotCompletedReassign", notCompletedReassignments.toString());
          }
        }
       
        // process notifications
        if (!notifications.isEmpty()) {
          StringBuffer notStartedNotifications = new StringBuffer();
          StringBuffer notCompletedNotifications = new StringBuffer();
          for (Notification notification : notifications) {
            if ("not-started".equalsIgnoreCase(notification.getType())) {
              if (notStartedNotifications.length() > 0) {
                notStartedNotifications.append(COMPONENT_SEPARATOR);
              }
              notStartedNotifications.append(notification.toDataInput());
            } else if ("not-completed".equalsIgnoreCase(notification.getType())) {
              if (notCompletedNotifications.length() > 0) {
                notCompletedNotifications.append(COMPONENT_SEPARATOR);
              }
              notCompletedNotifications.append(notification.toDataInput());
            }
          }
          if (notStartedNotifications.length() > 0) {
            work.setParameter("NotStartedNotify", notStartedNotifications.toString());
          }
          if (notCompletedNotifications.length() > 0) {
            work.setParameter("NotCompletedNotify", notCompletedNotifications.toString());
          }
        }
       
       
        work.setParameterDefinitions(((Work) value).getParameterDefinitions());
        return work;
    }
View Full Code Here

Examples of org.drools.process.core.Work

                            actionNode,
                            Node.CONNECTION_DEFAULT_TYPE );
        WorkItemNode workItemNode = new WorkItemNode();
        workItemNode.setId( 3 );
        workItemNode.setName( "WorkItem1" );
        Work work = new WorkImpl();
        work.setName( "MyWork" );
        workItemNode.setWork( work );
        process.addNode( workItemNode );
        new ConnectionImpl( actionNode,
                            Node.CONNECTION_DEFAULT_TYPE,
                            workItemNode,
                            Node.CONNECTION_DEFAULT_TYPE );
        WorkItemNode workItemNode2 = new WorkItemNode();
        workItemNode2.setId( 4 );
        workItemNode2.setName( "WorkItem2" );
        work = new WorkImpl();
        work.setName( "MyWork" );
        workItemNode2.setWork( work );
        process.addNode( workItemNode2 );
        new ConnectionImpl( workItemNode,
                            Node.CONNECTION_DEFAULT_TYPE,
                            workItemNode2,
                            Node.CONNECTION_DEFAULT_TYPE );
        WorkItemNode workItemNode3 = new WorkItemNode();
        workItemNode3.setId( 5 );
        workItemNode3.setName( "WorkItem3" );
        work = new WorkImpl();
        work.setName( "MyWork" );
        workItemNode3.setWork( work );
        process.addNode( workItemNode3 );
        new ConnectionImpl( workItemNode2,
                            Node.CONNECTION_DEFAULT_TYPE,
                            workItemNode3,
View Full Code Here

Examples of org.drools.process.core.Work

                            actionNode,
                            Node.CONNECTION_DEFAULT_TYPE );
        WorkItemNode workItemNode = new WorkItemNode();
        workItemNode.setId( 3 );
        workItemNode.setName( "WorkItem1" );
        Work work = new WorkImpl();
        work.setName( "MyWork" );
        workItemNode.setWork( work );
        process.addNode( workItemNode );
        new ConnectionImpl( actionNode,
                            Node.CONNECTION_DEFAULT_TYPE,
                            workItemNode,
View Full Code Here

Examples of org.hibernate.jdbc.Work

            }

            if (log.isDebugEnabled()) log.debug("Running statement: " + ddlStatement);
            new HibernateTxFragment() {
            protected void txFragment(Session session) throws Exception {
                Work w = new Work() {
                public void execute(Connection connection) throws SQLException {
                    Statement statement = null;
                    try {
                        statement = connection.createStatement();
                        statement.execute(ddlStatement);
View Full Code Here

Examples of org.hibernate.search.backend.Work

      searchFactoryImplementor.getWorker().performWork( work, transactionContext );

      // purge the subclasses
      Set<Class<?>> subClasses = builder.getMappedSubclasses();
      for ( Class clazz : subClasses ) {
        @SuppressWarnings( "unchecked" )
        Work subClassWork = new Work( clazz, id, WorkType.PURGE_ALL );
        searchFactoryImplementor.getWorker().performWork( subClassWork, transactionContext );
      }
    }
    else {
      work = new Work<T>( entityType, id, WorkType.PURGE );
View Full Code Here

Examples of org.hibernate.search.backend.spi.Work

        operation = IndexingOverride.APPLY_DEFAULT;
        break;
      default:
        throw new AssertionFailure( "Unknown work type: " + work.getType() );
    }
    Work result = work;
    Class<?> entityClass = work.getEntityClass();
    switch ( operation ) {
      case APPLY_DEFAULT:
        break;
      case SKIP:
        result = null;
        log.forceSkipIndexOperationViaInterception( entityClass, work.getType() );
        break;
      case UPDATE:
        result = new Work( work.getEntity(), work.getId(), WorkType.UPDATE );
        log.forceUpdateOnIndexOperationViaInterception( entityClass, work.getType() );
        break;
      case REMOVE:
        //This works because other Work constructors are never used from WorkType ADD, UPDATE, REMOVE, COLLECTION
        //TODO should we force isIdentifierRollback to false if the operation is not a delete?
        result = new Work( work.getEntity(), work.getId(), WorkType.DELETE, work.isIdentifierWasRolledBack() );
        log.forceRemoveOnIndexOperationViaInterception( entityClass, work.getType() );
        break;
      default:
        throw new AssertionFailure( "Unknown action type: " + operation );
    }
View Full Code Here

Examples of org.jboss.capedwarf.server.api.tx.Work

      }
      tuple.count++;

      try
      {
         return new Work()
         {
            @Override
            protected Object work() throws Exception
            {
               return invocation.proceed();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.