Search in sources :

Example 1 with AssignableOp

use of com.liferay.ide.kaleo.core.op.AssignableOp in project liferay-ide by liferay.

the class RoleNamePossibleValuesMetaService method initIfNecessary.

protected void initIfNecessary(Object object) {
    if (object instanceof WorkflowDefinition) {
        for (WorkflowNode node : ((WorkflowDefinition) object).getDiagramNodes()) {
            Assignable assignable = node.nearest(Assignable.class);
            if (assignable != null) {
                for (Role role : assignable.getRoles()) {
                    Value<String> roleName = role.getName();
                    String name = roleName.content(false);
                    if (!CoreUtil.isNullOrEmpty(name)) {
                        _originalRoleNames.add(name);
                    }
                }
            }
        }
    } else if (object instanceof AssignableOp) {
        ElementList<RoleName> roleNames = ((AssignableOp) object).getRoleNames();
        for (RoleName roleName : roleNames) {
            Value<String> nameValue = roleName.getName();
            String name = nameValue.content(false);
            if (!CoreUtil.isNullOrEmpty(name)) {
                _originalRoleNames.add(name);
            }
        }
    }
}
Also used : Role(com.liferay.ide.kaleo.core.model.Role) AssignableOp(com.liferay.ide.kaleo.core.op.AssignableOp) RoleName(com.liferay.ide.kaleo.core.model.RoleName) Value(org.eclipse.sapphire.Value) WorkflowDefinition(com.liferay.ide.kaleo.core.model.WorkflowDefinition) ElementList(org.eclipse.sapphire.ElementList) WorkflowNode(com.liferay.ide.kaleo.core.model.WorkflowNode) Assignable(com.liferay.ide.kaleo.core.model.Assignable)

Example 2 with AssignableOp

use of com.liferay.ide.kaleo.core.op.AssignableOp in project liferay-ide by liferay.

the class RoleNamePossibleValuesService method _initMetaServiceIfNecessary.

private void _initMetaServiceIfNecessary() {
    WorkflowDefinition definition = _op().nearest(WorkflowDefinition.class);
    if (definition != null) {
        _metaService.initIfNecessary(definition);
    }
    AssignableOp assignableOp = _op().nearest(AssignableOp.class);
    if (assignableOp != null) {
        _metaService.initIfNecessary(assignableOp);
    }
}
Also used : AssignableOp(com.liferay.ide.kaleo.core.op.AssignableOp) WorkflowDefinition(com.liferay.ide.kaleo.core.model.WorkflowDefinition)

Aggregations

WorkflowDefinition (com.liferay.ide.kaleo.core.model.WorkflowDefinition)2 AssignableOp (com.liferay.ide.kaleo.core.op.AssignableOp)2 Assignable (com.liferay.ide.kaleo.core.model.Assignable)1 Role (com.liferay.ide.kaleo.core.model.Role)1 RoleName (com.liferay.ide.kaleo.core.model.RoleName)1 WorkflowNode (com.liferay.ide.kaleo.core.model.WorkflowNode)1 ElementList (org.eclipse.sapphire.ElementList)1 Value (org.eclipse.sapphire.Value)1