Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.CallActivity


    return ELEMENT_CALL_ACTIVITY;
  }
 
  @Override
  protected BaseElement convertXMLToElement(XMLStreamReader xtr) throws Exception {
    CallActivity callActivity = new CallActivity();
    callActivity.setCalledElement(xtr.getAttributeValue(null, ATTRIBUTE_CALL_ACTIVITY_CALLEDELEMENT));
    parseChildElements(getXMLElementName(), callActivity, xtr);
    return callActivity;
  }
View Full Code Here


    return callActivity;
  }

  @Override
  protected void writeAdditionalAttributes(BaseElement element, XMLStreamWriter xtw) throws Exception {
    CallActivity callActivity = (CallActivity) element;
    if (StringUtils.isNotEmpty(callActivity.getCalledElement())) {
      xtw.writeAttribute(ATTRIBUTE_CALL_ACTIVITY_CALLEDELEMENT, callActivity.getCalledElement());
    }
  }
View Full Code Here

    }
  }

  @Override
  protected void writeAdditionalChildElements(BaseElement element, XMLStreamWriter xtw) throws Exception {
    CallActivity callActivity = (CallActivity) element;
    writeIOParameters(ELEMENT_CALL_ACTIVITY_IN_PARAMETERS, callActivity.getInParameters(), xtw);
    writeIOParameters(ELEMENT_CALL_ACTIVITY_OUT_PARAMETERS, callActivity.getOutParameters(), xtw);
  }
View Full Code Here

    return "Opens a specified call element for a call activity.";
  }

  @Override
  public boolean canExecute(ICustomContext context) {
    final CallActivity ca = getCallActivity(context);

    if (ca == null) {
      return super.canExecute(context);
    } else {
      return true;
View Full Code Here

    return "Open Called Element";
  }

  @Override
  public void execute(ICustomContext context) {
    final CallActivity ca = getCallActivity(context);
    final String calledElement = ca.getCalledElement();

    if (calledElement != null && StringUtils.isNotBlank(calledElement)) {
      final Set<IFile> dataFiles = ActivitiWorkspaceUtil.getDiagramDataFilesByProcessId(calledElement);

      if (dataFiles.size() == 1) {
View Full Code Here

          ContextMenuEntry subMenuDelete = new ContextMenuEntry(new DeletePoolFeature(getFeatureProvider()), context);
          subMenuDelete.setText("Delete pool"); //$NON-NLS-1$
          subMenuDelete.setSubmenu(false);
          menuList.add(subMenuDelete);
        } else if (object instanceof CallActivity) {
          final CallActivity ca = (CallActivity) object;
          final String calledElement = ca.getCalledElement();

          if (calledElement != null && StringUtils.isNotBlank(calledElement)
                  && ActivitiWorkspaceUtil.getDiagramDataFilesByProcessId(calledElement).size() == 1) {
            final ContextMenuEntry openCalledElement
              = new ContextMenuEntry(new OpenCalledElementForCallActivity(getFeatureProvider()), context);
View Full Code Here

  protected String getStencilId(FlowElement flowElement) {
    return STENCIL_CALL_ACTIVITY;
  }
 
  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    CallActivity callActivity = (CallActivity) flowElement;
    if (StringUtils.isNotEmpty(callActivity.getCalledElement())) {
      propertiesNode.put(PROPERTY_CALLACTIVITY_CALLEDELEMENT, callActivity.getCalledElement());
    }
   
    addJsonParameters(PROPERTY_CALLACTIVITY_IN, callActivity.getInParameters(), propertiesNode);
    addJsonParameters(PROPERTY_CALLACTIVITY_OUT, callActivity.getOutParameters(), propertiesNode);
  }
View Full Code Here

    parametersNode.put(EDITOR_PROPERTIES_GENERAL_ITEMS, itemsNode);
    propertiesNode.put(propertyName, parametersNode);
  }
 
  protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    CallActivity callActivity = new CallActivity();
    if (StringUtils.isNotEmpty(getPropertyValueAsString(PROPERTY_CALLACTIVITY_CALLEDELEMENT, elementNode))) {
      callActivity.setCalledElement(getPropertyValueAsString(PROPERTY_CALLACTIVITY_CALLEDELEMENT, elementNode));
    }
   
    callActivity.getInParameters().addAll(convertToIOParameters(PROPERTY_CALLACTIVITY_IN, elementNode));
    callActivity.getOutParameters().addAll(convertToIOParameters(PROPERTY_CALLACTIVITY_OUT, elementNode));
   
    return callActivity;
  }
View Full Code Here

 
  private void validateModel(BpmnModel model) {
    FlowElement flowElement = model.getMainProcess().getFlowElementMap().get("callactivity");
    assertNotNull(flowElement);
    assertTrue(flowElement instanceof CallActivity);
    CallActivity callActivity = (CallActivity) flowElement;
    assertEquals("callactivity", callActivity.getId());
    assertEquals("Call activity", callActivity.getName());
   
    assertEquals("processId", callActivity.getCalledElement());
   
    List<IOParameter> parameters = callActivity.getInParameters();
    assertEquals(2, parameters.size());
    IOParameter parameter = parameters.get(0);
    assertEquals("test", parameter.getSource());
    assertEquals("test", parameter.getTarget());
    parameter = parameters.get(1);
    assertEquals("${test}", parameter.getSourceExpression());
    assertEquals("test", parameter.getTarget());
   
    parameters = callActivity.getOutParameters();
    assertEquals(1, parameters.size());
    parameter = parameters.get(0);
    assertEquals("test", parameter.getSource());
    assertEquals("test", parameter.getTarget());
  }
View Full Code Here

  }

  @Override
  public PictogramElement add(IAddContext context) {

    final CallActivity addedCallActivity = (CallActivity) context.getNewObject();
    final ContainerShape parent = context.getTargetContainer();

    // CONTAINER SHAPE WITH ROUNDED RECTANGLE
    final IPeCreateService peCreateService = Graphiti.getPeCreateService();
    final ContainerShape containerShape = peCreateService.createContainerShape(parent, true);

    // EList<Property> props = containerShape.getProperties();

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
    final int width = context.getWidth() <= 0 ? 105 : context.getWidth();
    final int height = context.getHeight() <= 0 ? 55 : context.getHeight();

    final IGaService gaService = Graphiti.getGaService();
    RoundedRectangle roundedRectangle; // need to access it later
    {
      // create invisible outer rectangle expanded by
      // the width needed for the anchor
      final Rectangle invisibleRectangle = gaService.createInvisibleRectangle(containerShape);
      gaService.setLocationAndSize(invisibleRectangle, context.getX(), context.getY(), width, height);

      // create and set visible rectangle inside invisible rectangle
      roundedRectangle = gaService.createRoundedRectangle(invisibleRectangle, 5, 5);
      roundedRectangle.setParentGraphicsAlgorithm(invisibleRectangle);
      roundedRectangle.setStyle(StyleUtil.getStyleForTask(getDiagram()));
      roundedRectangle.setLineWidth(3);
      gaService.setLocationAndSize(roundedRectangle, 0, 0, width, height);

      // create link and wire it
      link(containerShape, addedCallActivity);
    }

    // SHAPE WITH TEXT
    {
      // create shape for text
      final Shape shape = peCreateService.createShape(containerShape, false);

      // create and set text graphics algorithm
      final MultiText text = gaService.createDefaultMultiText(getDiagram(), shape, addedCallActivity.getName());
      text.setStyle(StyleUtil.getStyleForTask(getDiagram()));
      text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);
      text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);
      Font font = null;
      if (OSUtil.getOperatingSystem() == OSEnum.Mac) {
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.CallActivity

Copyright © 2018 www.massapicom. 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.