use of com.centurylink.mdw.model.value.event.ExternalMessageVO in project mdw-designer by CenturyLinkCloud.
the class ActivityInstanceDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
layout.verticalSpacing = 1;
composite.setLayout(layout);
composite.getShell().setText("Activity Instance");
// activity name
Label nameLabel = new Label(composite, SWT.NONE);
nameLabel.setFont(new Font(nameLabel.getDisplay(), new FontData("Tahoma", 8, SWT.BOLD)));
GridData gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
nameLabel.setLayoutData(gd);
nameLabel.setText(activity.getName());
// high-level info
new Label(composite, SWT.NONE).setText("Instance ID: " + activityInstanceVO.getId());
Label spacer = new Label(composite, SWT.NONE);
gd = new GridData(SWT.LEFT);
gd.widthHint = 50;
spacer.setLayoutData(gd);
new Label(composite, SWT.NONE).setText("Start: " + activityInstanceVO.getStartDate());
new Label(composite, SWT.NONE).setText("Status: " + WorkStatuses.getWorkStatuses().get(activityInstanceVO.getStatusCode()));
spacer = new Label(composite, SWT.NONE);
spacer.setLayoutData(gd);
new Label(composite, SWT.NONE).setText("End: " + activityInstanceVO.getEndDate());
if (!mode.equals(Mode.RETRY)) {
if (!mode.equals(Mode.SKIP)) {
if (activity.isAdapter() || activity.isStart() || activity.isEventWait()) {
ExternalMessageVO messageVO = getDesignerProxy().getExternalMessage(activity, activityInstanceVO);
if (!activity.isEventWait()) {
spacer = new Label(composite, SWT.NONE);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
gd.heightHint = 5;
spacer.setLayoutData(gd);
// request
Label label = new Label(composite, SWT.NONE);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
label.setLayoutData(gd);
label.setText(activity.isAdapter() ? "Adapter Request:" : "External Event Request:");
requestMessageText = new Text(composite, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
gd.widthHint = 500;
gd.heightHint = 180;
requestMessageText.setLayoutData(gd);
if (messageVO != null && messageVO.getRequest() != null)
requestMessageText.setText(messageVO.getRequest());
}
spacer = new Label(composite, SWT.NONE);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
gd.heightHint = 5;
spacer.setLayoutData(gd);
// response
Label label = new Label(composite, SWT.NONE);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
label.setLayoutData(gd);
label.setText(activity.isAdapter() ? "Adapter Response:" : activity.isEmpty() ? "Event Message:" : "Response Message:");
responseMessageText = new Text(composite, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
gd.widthHint = 500;
gd.heightHint = 180;
responseMessageText.setLayoutData(gd);
if (messageVO != null && messageVO.getResponse() != null)
responseMessageText.setText(messageVO.getResponse());
}
}
spacer = new Label(composite, SWT.NONE);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
gd.heightHint = 5;
spacer.setLayoutData(gd);
// completion code / status message
Label label = new Label(composite, SWT.NONE);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
label.setLayoutData(gd);
label.setText(mode.equals(Mode.VIEW) ? "Completion Code / Status Message:" : "Completion Code");
int style = SWT.BORDER;
if (mode.equals(Mode.VIEW))
style = style | SWT.READ_ONLY | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL;
completionCodeText = new Text(composite, style);
gd = new GridData(SWT.LEFT);
gd.horizontalSpan = 3;
gd.widthHint = 500;
if (mode.equals(Mode.VIEW))
gd.heightHint = 100;
completionCodeText.setLayoutData(gd);
if (mode.equals(Mode.VIEW) && activityInstanceVO.getStatusMessage() != null)
completionCodeText.setText(activityInstanceVO.getStatusMessage());
if (mode.equals(Mode.SKIP)) {
completionCodeText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
String compCode = completionCodeText.getText().trim();
completionCode = compCode.length() == 0 ? null : compCode;
}
});
}
}
return composite;
}
use of com.centurylink.mdw.model.value.event.ExternalMessageVO in project mdw-designer by CenturyLinkCloud.
the class RuntimeDataAccessRest method getExternalMessage.
// used by designer for displaying adapter raw message content
public ExternalMessageVO getExternalMessage(Long activityId, Long activityInstId, Long eventInstId) throws DataAccessException {
try {
String pathWithArgs = "Requests";
if (eventInstId != null)
pathWithArgs += "/" + eventInstId;
else
pathWithArgs += "?ownerId=" + activityInstId + "&type=outboundRequests";
if (!getServer().isSchemaVersion61()) {
pathWithArgs = "ExternalMessageInstance?format=json&activityId=" + activityId + "&activityInstId=" + activityInstId;
if (eventInstId != null)
pathWithArgs += "&eventInstId=" + eventInstId;
}
String response = invokeResourceService(pathWithArgs);
return new ExternalMessageVO(response);
} catch (IOException ex) {
throw new DataAccessOfflineException(ex.getMessage(), ex);
} catch (Exception ex) {
throw new DataAccessException(ex.getMessage(), ex);
}
}
Aggregations